Home › Forums › Add-ons › Repeater Field › My code doesn't work › Reply To: My code doesn't work
I can resolve my problem, however the last loop doesn’t work. The loop repeat the same information and it shows the title and link of the current post.
Code:
<?php if(have_rows('otros_archivos')):
while (have_rows('otros_archivos')) : the_row();
$post_object = get_sub_field('antecedente');
echo "<ol>";
if($post_object):
$post = $post_object; setup_postdata($post); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php wp_reset_postdata();
else:
echo "<li>No se ha incluido ningún antecedente aún.</li>";
endif;
echo "</ol>";
endwhile;
endif; ?>
You can see the results on this webpage.
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.