Home › Forums › Add-ons › Gallery Field › display first gallery picture on archive page › Reply To: display first gallery picture on archive page
Hi, I’ve just tried to code above and it seems to work perfectly
One quick question I show my featured image as a large product image then have the others as thumbnails in a gallery
Is there a way to exclude the featured image from the returned gallery results?
This is the code I’m using to display the gallery
Thanks
Lee
<?php $images = get_field(‘image_gallery’);
if( $images ) { ?>
<div id=”imagegallery”>
<?php foreach( $images as $image ) { ?>
” alt=”<?php echo $image[‘alt’]; ?>” class=”alignleft” />
<?php } ?>
</div>
<?php } ?>
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.