Support

Account

Home Forums Add-ons Repeater Field Need basic help with accessing repeater array Reply To: Need basic help with accessing repeater array

  • I’m assuming you are doing this within the loop and you don’t have to set up postdata. With that said, since you have a post object field inside a repeater, you dont have to use the foreach loop.

    <?php while(has_sub_field('post_links')): ?>
    	<?php $post_objects = get_sub_field('items'); ?>
    	<ul>
    	    <li>
    			<a href="<?php echo get_permalink($post_objects->ID); ?>"><?php echo get_the_title($post_objects->ID); ?></a>
    
    		</li>
    	</ul>
    <?php endwhile; ?>