Home › Forums › Front-end Issues › Link field not working › Reply To: Link field not working
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!
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.