I have to set the global $post at the top of this to make it work outside of the loop. For some reason if I setup another relationship field underneath this one it does not work. Can someone explain to me why this is and how to make it so I can have multiple relationship fields working outside of the main loop.
The relationship field is pulling in the data from the page that I am on, which is correct. My issue comes if I duplicate the code above and paste it below it (to have 2 instances of the same code), I would assume that the same data would appear below, but that 2nd instance does not appear.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users