1<?php if( have_rows('slides') ): ?>
2 <ul class="slides">
3 <?php while( have_rows('slides') ): the_row();
4 $image = get_sub_field('image');
5 ?>
6 <li>
7 <?php echo wp_get_attachment_image( $image, 'full' ); ?>
8 <p><?php the_sub_field('caption'); ?></p>
9 </li>
10 <?php endwhile; ?>
11 </ul>
12<?php endif; ?>
1<?php
2$rows = get_field('repeater_field_name');
3if( $rows ) {
4 echo '<ul class="slides">';
5 foreach( $rows as $row ) {
6 $image = $row['image'];
7 echo '<li>';
8 echo wp_get_attachment_image( $image, 'full' );
9 echo wpautop( $row['caption'] );
10 echo '</li>';
11 }
12 echo '</ul>';
13}