The Repeater field is a really good solution for repeating content like slides, team members, directory, and many more repeating contents.
The Repeater field type acts as a parent to a set of sub fields which can be repeated again and again and there are no limits to the number of repeats either as long as you don’t specify.
The Repeater field will return an array of rows, where each row is an array containing sub field values.
When you add a repeater field, it creates additional functions specifically for looping over rows and accessing sub field values like have_rows, the_row, get_sub_field, and the_sub_field functions.
How to loop through a Repeater field and generate the HTML for a basic image slider?
How to manually loop over a Repeater field value using a foreach loop?
';
foreach( $rows as $row ) {
$image = $row['image'];
echo ' ';
echo wp_get_attachment_image( $image, 'full' );
echo wpautop( $row['caption'] );
echo ' ';
}
echo '';
}
ACF advanced custom forEach loop repeater slider