Home › Forums › Add-ons › Repeater Field › Loop else doesn't work › Reply To: Loop else doesn't work
Finally I edit my code and works!
This is the code:
<?php if(have_rows('otros_archivos')): while (have_rows('otros_archivos')) : the_row(); $post_object = get_sub_field('antecedente'); if($post_object): $post = $post_object; setup_postdata($post); ?> <a href="<?php the_permalink(); ?>" target="_blank"><?php the_title(); ?></a> <br/><br/> <?php wp_reset_postdata(); else: echo "<i>No se ha incluido ningún antecedente aún.<br/></i>"; endif; endwhile; endif; ?>
Anyway thanks for your help James.
I hope this code can help someone!
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!
🤔 Curious about the ACF user experience? So are we! Help guide the evolution of ACF by taking part in our first ever Annual Survey and guarantee you’re represented in the results. https://t.co/0cgr9ZFOJ5— Advanced Custom Fields (@wp_acf) May 8, 2023
© 2023 Advanced Custom Fields.