Thanks for the reply!
Yes your right, I had another go and it worked straight away! Must have been having an off day, spent a good hour trying to get it to work but must have missed something obvious (have deleted the code so not sure what I was doing wrong!)
Working code here incase anyone else gets stuck!
<?php // check if the repeater field has rows of data if( have_rows('repeater') ): // loop through the rows of data while ( have_rows('repeater') ) : the_row(); // display a sub field value $images = get_sub_field('gallery'); if( $images ): ?> <?php foreach( $images as $image ): ?> <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" /> </li> <?php endforeach; endif;?> <?php endwhile; else : // no rows found endif; ?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!