Display Gallery for Advanced Custom Fields
This snippet is for the Advanced Custom Fields Gallery Plugin.
1 2 3 4 5 6 7 8 9 | <?php $images = get_field('image_gallery'); if( $images ): ?> <ul id="image-gallery"> <?php foreach( $images as $image ): ?> <li><a href="<?php echo $image['url']; ?>" class="lightbox"><img src="<?php echo $image ['sizes']['gallery-thumb']; ?>" alt="<?php echo $image['alt']; ?>" /></a></li> <?php endforeach; ?> </ul> <?php endif; ?> |
Change ‘gallery-thumb’ to the name of the thumbnail image you want to use. For full size images us ‘url’ or ‘large’