Trying to get a gallery I have within a repeater field to display images when clicked in a lightbox. I have installed Simple Lightbox plugin, but cannot get them to display in a lightbox. My code for the gallery is:
if( $images ):?>
<?php foreach( $images as $image ): ?>
<a href="<?php echo $image['url']; ?>">
<img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>" />
<?php endforeach; ?>
This all works fine, and displays the relevant images for each repeater field, but I’m unsure of how to get it to use lightbox.
I’m not familiar with the code involved to make the images work with this plugin.
This is what I would do. Insert an image into the content editor of a post. View the post on the front end and see what additional code is added to this image that makes it appear in the lightbox. Using this information, adjust my code that’s outputting my images to match the code that’s output by the plugin.
Hope that helps.