Home › Forums › Add-ons › Repeater Field › Displaying repeater field data › Reply To: Displaying repeater field data
Ah! you need to pass the ‘options’ parameter! code below should work.
<?php while(has_sub_field('top_links' , 'options')): ?>
<li>
<a href="<?php the_sub_field( 'link_url'); ?>" target="_blank">
<img src="<?php $image = get_sub_field('link_image'); echo $image['url'] ?>" alt="<?php the_sub_field('link_name') ?>">
</a>
</li>
<?php endwhile ?>
edit: updated the code to add the alt tag (using the link_name sub field)
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.