Oh, the number of times I’ve copied and pasted these code snippets …

The repeater field:

<?php
if( have_rows('repeater_field_name') ):
while ( have_rows('repeater_field_name') ) : the_row();
the_sub_field('sub_field_name');
endwhile;
else :
endif;
?>

Image field:


<?php
$image = get_field('image');
if( !empty($image) ): ?>
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
<?php endif; ?>


<?php
$image = get_field('image');
if( !empty($image) ):
$title = $image['title'];
$alt = $image['alt'];
$caption = $image['caption'];
$size = 'thumbnail';
$thumb = $image['sizes'][ $size ];
$width = $image['sizes'][ $size . '-width' ];
$height = $image['sizes'][ $size . '-height' ];
?>

<img src="<?php echo $thumb; ?>" alt="<?php echo $alt; ?>" width="<?php echo $width; ?>" height="<?php echo $height; ?>" />
<?php endif; ?>