Okay, so I see there is this — http://www.advancedcustomfields.com/resources/filters/acf-fields-relationship-query/
But I wish there was an example of it in use, not just in the functions.php. I’m still not sure how to actually use it in my case.
Ah-ah, I found a workaround. I just noticed now that the ACF relationship docs have a second option that doesn’t set postdata: http://www.advancedcustomfields.com/resources/field-types/relationship/
/*
* Loop through post objects ( don't setup postdata )
* Using this method, the $post object is never changed so all functions need a seccond parameter of the post ID in question.
*/
$posts = get_field('relationship');
if( $posts ): ?>
<ul>
<?php foreach( $posts as $post_object): ?>
<li>
<a href="<?php echo get_permalink($post_object->ID); ?>"><?php echo get_the_title($post_object->ID); ?></a>
<span>Post Object Custom Field: <?php the_field('field_name', $post_object->ID); ?></span>
</li>
<?php endforeach; ?>
</ul>
<?php endif;
This helps me avoid the situation!
It actually fails after the first relationship field (“research centers”) so then the second relationship field (“presenters”) also doesn’t display.
I had considered doing what you suggest… but I figured it would be better if I could just reset things properly. 🙂
Thank you for looking… if you have any other ideas, let me know.