Support

Account

Home Forums Add-ons Repeater Field Loop else doesn't work Reply To: Loop else doesn't work

  • Hi again!

    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!