How do I get the images that are returning and transform into a gallery?

0

I'm using a mixture of WordPress plugin with PHP code to be able to perform a task that is to join all the images of a certain post in a gallery.

I would like, in this code below, to know how I could play all the images returned in a gallery and show one after another.

if( class_exists('Dynamic_Featured_Image') ) {

    $featured_images = $dynamic_featured_image->get_featured_images();

    foreach ($featured_images as $f_images) {

        $thumb = str_replace('150x150', '328x400', $f_images['thumb']);
        $real = $f_images['full'];

        echo "<a href=".$real." rel='lightbox'>";
            echo "<img src=".$thumb." rel='lightbox' />";
        echo "</a>";
    }
}

The $featured_images returns an array of images with two types of images that I rename each type as $thumb and $real . The thumb shows her small real shows her in a lightbox at actual size.

  

What is currently happening is that as the link and image are inside the foreach, every back of the foreach, it creates a new lightbox and what I wanted was to put everything together in a gallery.

    
asked by anonymous 24.12.2016 / 18:31

1 answer

0

I do not know if I understood your problem, because your question got a bit confusing But take a look at the documentation for the plugin that is using lightbox. Depending on which one you are using, a simple rel='lightbox[galeria]' resolves.

    
30.01.2017 / 12:13