Support

Account

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.