Support

Account

Home Forums Add-ons Repeater Field Post Object in Repeater only displaying first instance in loop Reply To: Post Object in Repeater only displaying first instance in loop

  • I’m not really sure how you’re even seeing one. If you have the post pbject field set up to allow multiple selections then it should be returning and array.

    
    <?php if( have_rows('select_mix') ):
      while (have_rows('select_mix')) : the_row(); ?>
    
      <?php $post_object = get_sub_field('mix_character_select'); ?>
    
      <?php if( $post_object ): ?>
        <?php 
    			foreach ($post_object as $post) { 
    				setup_postdata( $post ); ?>
    				<h2><?php the_title(); ?></h2>
    				<p>
    					<?php the_field('mix_description'); ?>
    				</p>
    				<?php 
    			} // end foreach post
    			endif; ?>
    
      <?php endwhile;
    endif; ?>
    
    <?php wp_reset_postdata(); ?>