Home › Forums › Add-ons › Repeater Field › URL field help › Reply To: URL field help
<?php if ( have_rows( 'my_repeater' ) ) : ?>
<?php while ( have_rows( 'my_repeater' ) ) : the_row(); ?>
<?php $url = get_sub_field( 'url' ); ?>
<?php if ( $url ) { ?>
<a href="<?php echo $url['url']; ?>" target="<?php echo $url['target']; ?>"><?php echo $url['title']; ?></a>
<?php } ?>
<?php endwhile; ?>
<?php else : ?>
<?php // no rows found ?>
<?php endif; ?>
The same, just use “get_sub_field”.
If you struggle with the code there is a premium plugin that gives you all the code: https://hookturn.io/downloads/acf-theme-code-pro/
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.