Support » Plugin: WordPress Gallery Plugin - NextGEN Gallery » [Plugin: NextGEN Gallery] [NextGen Gallery] Open album in lightbox

  • Resolved mvandemar


    I just had to solve the problem of opening up a NextGen Gallery album in a lightbox for a client (as opposed to opening it up in it’s own page first, and then clicking on a thumbnail to open the images in a lightbox), and due to the number of unanswered posts on the subject I thought I would go ahead and share my solution. This was done via a custom function, ngg’s templating system, and for what I was doing I wound up needing to use the PrettyPhoto Media plugin to get it all working nicely. First I added the following nggGetGallery() function to my client’s functions.php:

    Next I created a new template inside of nextgen-gallery/view/ named album-lightbox.php:

    This was based off of the album-compact.php template. The format for adding galleries is now:

    [album id=7 template=lightbox]

    This worked great, aside from the fact that with multiple albums on a single page it would treat them all as a single gallery. I solved this by installing the PrettyPhoto Media plugin:

    Then I went to Gallery -> Options -> Effects, changed the dropdown to Custom, and added this code:


    And voila, it all worked. I hope this helps someone else looking for a solution to that.


Viewing 15 replies - 31 through 45 (of 74 total)
  • Hi Brendon,

    Thanks for the reply.. I have done what you suggested but I am still getting the full view of pictures on my site ( (I did have the wrong shortcode before – I was trying to get an album not a gallery up).

    I have amended two lots of photos in one of the posts (David Sheldrick) and you should be able to see that the last two lot are the full gallery instead of the one picture – a preview picture has been selected for each gallery.



    @brendon – I just looked at the page that you linked to originally, and it looks like you are not doing what the other people here are attempting to do. You still have a layout that shows all of the thumbnails for the entire gallery at once. What this tutorial does is it allows you to launch an entire gallery from a single thumbnail. Your site is just using the normal behavior.

    @stephanie, shoot me an email, I can set it up for you if you like, it should only take me a couple of minutes. It’s michael at endless poetry dot com, no spaces.

    thanks all,


    @michael… Ah, I see what you mean now… “Open album in lightbox”, and you are right that I don’t make use of the Album feature. My apologies for misunderstanding the thread.

    @stephanie, hopefully Michael can help you get your album’s sorted, as he is right that I’m not doing what you are actually looking for it seems.

    Best of luck.

    To get a lightbox to work with NG Gallery you need to install a plugin called “wp-jquery-lightbox” and then in the Options/Effects select lightbox.

    @michael, you mentioned you had to de-link the name of the gallery in the text link below the thumbnails..

    could you share some details on that, please ? how you did it ?



    I’m using this code, too – since today 😉 It is THIS code I was looking for the last days … and it works fine… but only with galleries / album which where at wordpress BEFORE edit the code / made changes… all galleries / albums I make new, there is now thumbnail at the album-overview 🙁

    what can the problem be? any ideas?

    more information: when I have a NEW gallery and take it in an “old” album – it is shown with thumbnail in overview… but as soon as I take it in a “new” album (made aber changing the code) – then the thumbnail is black and no pic in it.

    oh and question – isn’t it possible to EDIT or DELETE a post here in the forum?

    Hi, First of all the adaptation works really great. Do you have the code to the extend album?

    Thanks in advance

    sure I have 😉

    THIS is a link that WORKS (with thumbnails)
    [nggalbum id=12 template=lightbox]

    and THIS is a link without thumbnails)
    [nggalbum id=14 template=lightbox]

    oh and I found out – a album with ID 2 .. that is made before changing code, but still – no thumbnails. When I made ne galleries and take them to ID 12 there the thumbnails are visible.

    here’s a link:
    — international is working (made all before changing code)
    — roy hammer & national is not working 🙁

    I am thinking if it would be possible to have a extra selection in Edit Page when you click the [Add NextGEN gallery].

    At the moment there are two options under Album tab:
    -Extended version
    -Compact version

    Would it be good if we can add in “LightBox” into this option selection.

    Anyone have any idea. Sorry, I am a newbie to WP, so not good at looking for the codes.

    oh I just select compact and then change it in lightbox…. as long as it works… at the moment I have the problem with thumbnails 🙁

    Your International Cover Image is linked to
    but your National image is linked to

    You can double check your image linking. Otherwise its best to re-upload your National gallery.

    it looks like it’s an error with the gallerie plugin .. don’t know how to change the links… with roy hammer – i deleted and made the album new and uploaded all images new – but it will not work. back to “original ngg” it’s still not working, too with compact albumview. But don’t know what the error is.

    Just wondering why it works with some album and not with all (newer ones)…

    Do you mean the NextGEN Gallery or the prettyPhoto Media plugin ?
    Have you check your WP version and the gallery version ? Are they the latest version?

Viewing 15 replies - 31 through 45 (of 74 total)
  • The topic ‘[Plugin: NextGEN Gallery] [NextGen Gallery] Open album in lightbox’ is closed to new replies.