Support

Account

Home Forums Add-ons Repeater Field Nested Repeater to show only one result Reply To: Nested Repeater to show only one result

  • Hi @gavina1970

    The simpleset way is to break the while loop after you render the image like so:

    
    <?php while( has_sub_field('project_images') ): ?>
    	<?php $firstimage = wp_get_attachment_image_src(get_sub_field('project_image'), 'full'); ?>
    	<img src="<?php echo $firstimage[0]; ?>" alt="" style="display: none;" class="fp_preview" />
    	<?php break; ?>
    <?php endwhile; ?>
    

    That will break out of the nested loop and continue the previous loop.

    Hope that helps.

    Thanks
    E