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!
We've just released ACF 5.12.3 with a security fix to prevent arbitrary file uploads to forms with ACF fields.— Advanced Custom Fields (@wp_acf) July 14, 2022
Now that we've released this update, we recommend updating your sites as soon as possible.
© 2022 Advanced Custom Fields.