Support

Account

Home Forums Front-end Issues Nested Post Object Fields Reply To: Nested Post Object Fields

  • @hube2 Many thanks for the further input.

    At first glance I couldn’t see anything in your notes that I hadn’t tried. Then I noticed that you were referring to using a nested Relationship field instead of nested Post Object fields and the penny dropped for how I should be solving this. As Post Objects seem to only work using $post, your code was obviously not working. Switching to using a Relationship field instead, and using your suggested code is now working just great.

    I just need to remember for future instances that Relationship fields should be the way to go instead of Post Objects for most uses, as they are able to use their own separate query, without getting thrown by being forced to use the main setup_postdata($posts) query.

    I’ve probably worded all that horribly, but hopefully you get the idea! Thanks to all for the help!