1<?php
2
3// check if the repeater field has rows of data
4if( have_rows('repeater_field_name') ):
5
6 // loop through the rows of data
7 while ( have_rows('repeater_field_name') ) : the_row();
8
9 // display a sub field value
10 the_sub_field('sub_field_name');
11
12 endwhile;
13
14else :
15
16 // no rows found
17
18endif;
19
20?>
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}
1<?php
2
3$rows = get_field('repeater_field_name');
4if($rows)
5{
6 echo '<ul>';
7
8 foreach($rows as $row)
9 {
10 echo '<li>sub_field_1 = ' . $row['sub_field_1'] . ', sub_field_2 = ' . $row['sub_field_2'] .', etc</li>';
11 }
12
13 echo '</ul>';
14}