Home › Forums › Front-end Issues › Repeater field not working in archive-product.php › Reply To: Repeater field not working in archive-product.php
Maybe it will help you, I solved it. The individual vars must be called within the repeater. In my case:
<?php if( have_rows('affiliatepartner') ): ?>
<div class="external-links">
<?php while( have_rows('affiliatepartner') ): the_row(); ?>
<?php
$produkturl = get_sub_field('produkturl');
$buttontext = get_sub_field('buttontext');
?>
<a href="<?php echo esc_url( $produkturl ); ?>" class="button product_type_external" aria-label="<?php echo $buttontext; ?>" rel="nofollow" target="_blank"><?php echo $buttontext; ?></a>
<?php endwhile; ?>
</div>
<?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.