Support

Account

Home Forums Add-ons Repeater Field Multiple Image Sizes Reply To: Multiple Image Sizes

  • You’d be able to do this if you do an incrementing variable like:

    <?php $i = 1; if( get_field('repeater') ): while( has_sub_field('repeater') ): ?>
              
         <?php if ( $i == 1 ) { ?>
         This is first list item
    <?php } elseif ( $i == 2 ) { ?>
    This is second list item
    <?php } elseif ( $i == 3 ) { ?>
    This is third list item
    <?php } elseif ( $i == 4 ) { ?>
    This is the fourth list item and so on...
    <?php } ?>
    
    <?php $i++; endwhile; endif; ?> 

    I wouldn’t duplicate the entire block of content that way but maybe like assign the image size to a variable and call it later or just do the $i conditional on the spot with the call to the image or similar. Hopefully that makes sense.