Home › Forums › ACF PRO › Relationship field: how to dynamically populate landing page with CPT content › Reply To: Relationship field: how to dynamically populate landing page with CPT content
If your relationship field allows more than one value then it will return an array of ID’s and if you are only returning the IDs then you don’t need $post->
you only use this when using setup_postdata()`
$ids = get_field('conference_talks', false, false);
foreach ($ids as $id) {
$value = get_field('my_acf_field_name', $id);
}
All of this is explained in the documentation https://www.advancedcustomfields.com/resources/relationship/
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.