Home › Forums › Add-ons › Repeater Field › Displaying Thumbnails with Repeater field › Reply To: Displaying Thumbnails with Repeater field
This is now my current code –
<?php if(get_field('images')): ?>
<?php $size = "thumbnail";?>
<?php while( has_sub_field('images')): ?>
<?php $image = wp_get_attachment_image_src(get_sub_field('image'), 'full'); ?>
<?php $thumb = wp_get_attachment_image_src(get_sub_field('image'), 'thumbnail' ); ?>
<div class="item">
<!-- Lightbox Image's -->
<a href="<?php the_sub_field('image');?>" class="fancybox" rel="gallery_group">
<!-- Thumbnail Image's -->
<img src="<?php echo $thumb;?>">
</a>
</div> <!-- End item -->
<?php endwhile; ?>
<?php endif; ?>
And outputs this –
<div class="item">
<!-- Lightbox Image's -->
<a href="359" class="fancybox" rel="gallery_group">
<!-- Thumbnail Image's -->
<img src="Array">
</a>
</div> <!-- End item -->
<div class="item">
<!-- Lightbox Image's -->
<a href="358" class="fancybox" rel="gallery_group">
<!-- Thumbnail Image's -->
<img src="Array">
</a>
</div> <!-- End item -->
<div class="item">
<!-- Lightbox Image's -->
<a href="357" class="fancybox" rel="gallery_group">
<!-- Thumbnail Image's -->
<img src="Array">
</a>
</div> <!-- End item -->
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.