• Hello good folks of WordPress. NextGen is my go-to gallery plugin and I recently had an odd request from one of my clients. He needed me to link to the next gen slideshow (using lightbox mode) not through the auto-generated thumbnails created by the next gen gallery shortcode but through a custom image link. I figured out that the best way to do this would be to display the thumbnails (with the shortcode) and grab the link to the HTML output of the first linked thumbnail. Example:

    <a rel="lightbox[set_17]" title=" " href="http://www.example.com/wp-content/gallery/healthcare/cenerfield-render.jpg" class="cboxElement">

    If you were using shutter or some other effect, the relation attribute might be different but you get the idea. Once I had the link, I simply wrapped it around an image and hid the thumbnails using display:none. It worked perfectly except for one problem: the slideshow would display the first image twice! I discovered that many other next gen users were running into the problem as well.

    I’m happy to say that I have found a neat hack solution and I came here to share it with y’all. Instead of grabbing the HTML link of the first image in the slideshow, grab the second. So your relation will be exactly the same, except:

    <a rel="lightbox[set_17]" title=" " href="http://www.example.com/wp-content/gallery/healthcare/<strong>THIS PART HERE WILL BE YOUR SECOND IMAGE IN THE SLIDESHOW.JPG</strong>" class="cboxElement">

    Good luck! I hope I’ve helped someone out by posting this.

    EDIT: I spoke to soon. This does not remove the duplicate image. It only changes the order. But If you link to the last image in the slideshow, you can start from the beginning and have the duplicate images appear last. So instead of going:
    1 1 2 3 4 5

    You go:

    1 2 3 4 5 1 1 2 3 4 5 1 1 2 3 4 5

    It’s not a fix but better than where I was before… hopefully someone else can find a better solution.

    http://wordpress.org/extend/plugins/nextgen-gallery/

  • The topic ‘Link to image gallery through text or image/not with thumbnails[solution]’ is closed to new replies.