WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to show the gallery in a thickbox or shutter window from a link. if i have a gallery [nggallery id=1] i want to have a link "view photos" and when i click on it a thickbox/shutter window should popup.

i have this working for shutter:

<div style="display: none;">[nggallery id=1]</div>
<a class="shutterset_set_1" href="/wp-content/gallery/a/dsc_7304mg.jpg">View photos</a>

and this working for thickbox:

<div style="display: none;">[nggallery id=6]</div>
<a class="thickbox" href="/wp-content/gallery/d/117.jpg" rel="set_6">View photos</a>

It opens but the images count is wrong.It counts the gallery images + the images in the page.In this case my gallery has 13 images but the first image(the one in the link) appears twice and then the count is 14 instead of 13.This is really annoying!!

is there a way to solve it? Is there an alternative to show the gallery via single link?

share|improve this question

closed as off-topic by Pieter Goosen, birgire, cybmeta, Mark Kaplun, kaiser Dec 4 '14 at 16:05

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 1 down vote accepted

I finally did it with jquery. I replaced all the image thumbs of the gallery with the link text and remove the text for all links except the first:

$(".ngg-galleryoverview").each(function(index) {
    $(this).find(".ngg-gallery-thumbnail-box .ngg-gallery-thumbnail a").html('View photos <span>&#187;</span>');
    $(this).find(".ngg-gallery-thumbnail-box .ngg-gallery-thumbnail a").addClass('small');
    $(this).find(".ngg-gallery-thumbnail-box:gt(0) .ngg-gallery-thumbnail a").html('');

With this script i can use the shortcode normally, just [nggallery id=1] and it works for both thickbox and shutter.

Hope this helps someone with the same problem i had :)

share|improve this answer

protected by Community Dec 13 '12 at 14:58

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.