Hi,
I am trying to display a gallery using the following code:
<?php
$images = get_sub_field('property_gallery');
if( $images ): ?>
<div class="gallery">
<ul>
<?php foreach( $images as $image ):
$content = '<li>';
$content .= '<a class="gallery_image" href="'. $image['url'] .'">';
$content .= '<img src="'. $image['sizes']['thumbnail'] .'" alt="'. $image['alt'] .'" />';
$content .= '</a>';
$content .= '</li>';
if ( function_exists('slb_activate') ){
$content = slb_activate($content);
}
echo $content;?>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
The code works but does not discriminate if the images are from a different post.
In my test I have 7 images. 4 for one post and 3 for another. When I click an image and opens in lightbox, it says 1 of 7 images.
How can I make each gallery open only images of a particular post.
Any help is much appreciated.
Hi @javiercastro
To anyone who may be interested:
From your other support request, we isolated the cause of this as some buggy code from the Simple lightbox plugin.