Pinterest Lightbox
Keeping the gallery within a single post in the Index page (2 posts)

  1. Demiscient
    Posted 3 years ago #

    I am using Simple Lightbox at the moment and Pinterest Lightbox seemed like the answer to putting a Pinterest button on images in my gallery until I clicked on an image in my Index page, it said "1 out of 16" instead of "1 out of 5", indicating that it's cycling through every image on the page instead of every image within the single post.

    I briefly considered trying to copy over the part of the code that makes Simple Lightbox only cycle through the images in a single post but I realised that I'm no codemonkey and it was like trying to translate a paragraph of text from French into Portuguese.

    Does anyone have any clue? :( There must be some sort of simple fix, right??


  2. jezz947
    Posted 3 years ago #

    Hello Demiscient,

    A simple hack worked for me,

    In the plugin core file pinterest-lightbox.php

    Find the below code

    	    var select = $('a[href$=".bmp"],a[href$=".gif"],a[href$=".jpg"], a[href$=".jpeg"], a[href$=".png"],a[href$=".BMP"],a[href$=".GIF"], a[href$=".JPG"],a[href$=".JPEG"],a[href$=".PNG"]');

    and replace with this

                var select = $('a[rel^="pinlight"]');
                select = $.unique( select );
                jQuery.each(select, function() {
                    var select2 = $('a[rel="'+this.rel+'"]');

    Also in Gallery -> Effects Change JavaScript Thumbnail effect to Custom and put the code rel="pinlight[%GALLERY_NAME%]" in the Link Code line.

    Hope this will help.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Pinterest Lightbox
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.