jquerywordpressthemeslightbox

open multiple images from one thumbnail in custom wordpress gallery


I made a custom gallery option for my theme using Advanced Custom Fields Plugin for WP. It lets the user upload images to a custom page which on clicking opens a lightbox to show the full-sized image. What I want to do now is open a gallery of images using just one thumbnail. The only thumbnail showing on the page will be one that gives the user an idea of what is inside.Any help would be appreciated.


Solution

  • You can either do it the conventional way (create a list of thumbnails linked to full-size images and display using something like Fancybox) and hide all but one of the thumbnails (see Fancybox FAQ), although that's not good for bandwidth if the gallery is going to have more than a handful of images; or you could use the thumnbail to launch a modal window and pull in the gallery from there. So the thumbnail would open a template file in a modal window like this:

    <a href="lightbox.php?galleryID=1" rel="fancybox" />
    

    Then lightbox.php can take the galleryID from the URL and create the gallery in whatever style you see fit.