OK, forget the “if” statement for now and don’t use the “esc_url”.
I’m using a repeater field and this worked for me:
<?php if( have_rows('lista_de_encuestas') ) : while ( have_rows('lista_de_encuestas') ) : the_row(); ?> <?php $pollUrls = get_sub_field('enlace_a_encuesta'); ?> <li> <a href="<?php echo $pollUrls['url']; ?>"><?php echo $pollUrls['title']; ?></a> </li> <?php endwhile; endif; ?>
Not sure if the if statement has something to do with it. I tried the same thing over and over and for some reason when I deleted everything and did it over again it worked. I triple checked the code before and I don’t think I had any typos or errors but… who knows :/
Hope this helps
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!