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; ?>
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.