Home Forums General Issues Trouble with resetting Reply To: Trouble with resetting

  • Ah-ah, I found a workaround. I just noticed now that the ACF relationship docs have a second option that doesn’t set postdata:

    *  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 ): ?>
    	<?php foreach( $posts as $post_object): ?>
    	    	<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>
    	<?php endforeach; ?>
    <?php endif;

    This helps me avoid the situation!