Home › Forums › Add-ons › Repeater Field › Gallery with main picture and thumbnails › Reply To: Gallery with main picture and thumbnails
<div class="col-left">
<?php
if( have_rows('product_gallery') ):
while ( have_rows('product_gallery') ) : the_row();
if (get_row_index() == 1) {
// currently showing the first row
?>
<img class="xzoom" src="<?php echo get_sub_field('product_image'); ?>" xoriginal="<?php echo get_sub_field('product_image'); ?>" /> // main image. I need to get values from thumbnails here after clicking on the thumbnail.
<?php
}
?>
<div class="xzoom-thumbs"> // thumbnails
<a href="<?php the_sub_field('product_image') ?>">
<img class="xzoom-gallery" width="80" src="<?php the_sub_field('product_image'); ?>" xpreview="<?php the_sub_field('product_image'); ?>">
</a>
</div>
<?php
endwhile;
else : ?>
<? 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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.