Home › Forums › Add-ons › Repeater Field › Repeater not working in IF › Reply To: Repeater not working in IF
You don’t need “the_row()” on the first line. The correct code would be:
<?php if(have_rows('activity_links')): ?>
<h3>Links</h3>
<ul>
<?php while(have_rows('activity_links')): the_row(); ?>
<li><a href="<?php echo the_sub_field('link_url'); ?>"><?php echo the_sub_field('name_for_link'); ?></a></li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
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.