WP jQuery Lightbox
[resolved] Title-captions Bug found, solved, and fix proposed (21 posts)

  1. josephknight
    Posted 5 years ago #

    Hi Ulf,
    Thanks first of all for such a simple and elegant lightbox solution for wordpress.

    However I found a bug and coded in a little solution.
    If some images in a set have the link title set and the rest of the images do not then this bug happens:
    When flipping through the lightbox pages the title-less links should not have a caption. However all the title-less images in the set will contain the last image's caption when flipping through. In other words, there's no code that says "hey if this image doesn't have the ahref title element set, then hide the caption.

    You can replicate this bug by creating a set of 2 images in a post and then give only one of their surround link's a title attribute. The caption will show up for the image with the titled link and will carry over to the image with the un-titled link (even tho this image should not have a caption).

    I found this code in the original jquery lightbox plugin and inserted it into your wp plugin. It hides the caption just before each image is paged into view and only shows it if the title actually contains something. It's just 2 lines of code:


    function updateDetails() {
    		    /* BEGIN ADDITION */
       			$('#imageDataContainer').slideDown('fast');//<-- important but missing from your version
    			$('#caption').hide();//<-- important but missing from your version
    		    /* END ADDITION */


    I beg you to make an awesome plugin even closer to perfect and add this code then update the plugin in the wordpress plugin repository.

    Thanks for your port, it's my favorite.

  2. josephknight
    Posted 5 years ago #

    Also, in the admin page for the plugin, in your example you tell the folks that to use groups enter a rel attribute with "lightbox" plus the groupname. However you proceed to show them an example of:

    <a href="images/image-1.jpg" rel="roadtrip[roadtrip]">image #1</a>
    <a href="images/image-2.jpg" rel="roadtrip[roadtrip]">image #2</a>
    <a href="images/image-3.jpg" rel="roadtrip[roadtrip]">image #3</a>

    These should be:

    ... rel="lightbox[roadtrip]" ...
  3. ulfben
    Plugin Author

    Posted 5 years ago #

    Fixed. WordPress will notify you of the version 1.1 release soon.

    Many thanks!

  4. Clinton
    Posted 5 years ago #

    Nice work indeed, Ulf...many thanks! Any suggestions on how to get the captions/descriptions from media images to automatically display under the title in the lightbox display?

    My apologies if I'm missing something simple...

  5. ulfben
    Plugin Author

    Posted 5 years ago #

    Grab the development version here and let me know if it works.

    * Added support for Media Library titles and captions.
    * Minified the javascript (8.6KB vs 17.8KB)
    * Minified the CSS (2.0KB vs 2.7KB)

    Note that descriptions are never output with the default gallery-shortcode, so they're not available for the lightbox.

    However, if you use the Cleaner Gallery plugin you can have captions auto-linked to the attachments' own post (where description, commenting etc are all available). This works fine with my plugin to. :)

  6. Clinton
    Posted 5 years ago #

    Worked like a charm! And thanks for the tip about the Cleaner Gallery plugin...I'll try that out as it sounds exactly like what I was hoping to do (add a "view details" link in the caption section of the ligthbox). Thanks again!

  7. Michael Goitein
    Posted 5 years ago #

    Ulf -
    I found a bug with the new version of the plugin.

    I'm going to just put in some representative code, as the site is for a client and off-limits:

    [caption id="attachment_1228" align="alignright" width="227" caption="The photo caption"]<img src="http://www.sd.com/wp-content/uploads/2010/10/the-photo.jpg" alt="" width="227" height="300" class="size-medium wp-image-1228" />[/caption]

    What was happening here was that the caption was being duplicated, as your plugin seemed to be picking up the [caption] in addition to the "title" as the caption. I had to switch to another lightbox plugin due to this bug. (Lightbox 2)

    Please let me know if you need any more info, or if this makes sense.

  8. ulfben
    Plugin Author

    Posted 5 years ago #

    That's intended. The plugin will pick out title *and* caption and use them both when available.

    Since it seems common for people to write the same stuff in both Title and Caption fields of the Media Library, I went ahead and added a check so the plugin uses only Caption if they're textually identical.

    Ie: 1.2.1 will compare texts but still use the caption's HTML. (see the post above yours for an example of why that's important)

    The repo will update within 15 minutes.

  9. jlevant
    Posted 5 years ago #

    Will settings be available soon? I have just redone my site using nextgen and WP jquery lightbox, and basically I am happy. However I would like the option to change the color of the frames as well as the size (very small for my gallery). I would also like the option to have the image name or 'alt' text displayed along with the image number.
    (Note this is not being used in my blog posts, just my portfolio galleries). Thanks.

  10. ulfben
    Plugin Author

    Posted 5 years ago #

    Sure. Email me for a quote. (ulf at ulfben dot com)

  11. jlevant
    Posted 5 years ago #

    That doesn't seem a helpful response. Why is there a settings link if it won't open?

  12. ulfben
    Plugin Author

    Posted 5 years ago #

    You made a bunch of feature requests, but now changed it to a bug report.

    The Settings panel works on all of my installations. Perhaps this can help you: http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-is-there-a-way-to-set-any-options?replies=3

  13. ToolboxDesigns
    Posted 5 years ago #

    I am using this script and the captions are not displaying.
    I have check that i have all the right requirements.

    The site I am refering to is:


    Just click on any of the thumbnails and it with fire the lightbox function.

    Could you please give me some feedback as to what might be going wrong.

    Toolbox Designs.

  14. capeinfo
    Posted 5 years ago #


    Great plugin, thanks. I've started using a CDN while also combines files and I'm getting a JS error for this plugin: "d.prototype is undefined".

    I'm clueless about code so I haven't the vaguest idea what to fix.

  15. nderambure
    Posted 5 years ago #

    Hi all,
    It seems that in the last version I've found a bug. If you use a dash in image title name and copy exactly same text to legend, the comparaison failed for equality between this two values. The "-" is transformed into HTML entities "$dash;" for one value of both.
    So I see 2 times same text in image lightbox, title an caption, with the "&dash" in caption.

    Can you reproduce this ?
    big thx anyway for this plugin !

  16. vesselds
    Posted 5 years ago #

    Great plugin!

    I have used it in a client site (still in the preliminary stages...) but what I am noticing is that when I click on a thumbnail and the lightbox loads, you can see the navigation bar of the site through the lightbox.

    Please take a look at this:

    *Click on a thumbnail without scrolling down and you will see the navigation bar through the pop up.

    I really need to get this resolved asap and have been looking high and low all over the web for a solution, but have unfortunately not been able to find any help.

    Hopefully you can shed some light.
    *Fingers crossed.


  17. nderambure
    Posted 5 years ago #

    @vesselds : it's a problem of z-index. Check the z-index property for your navigation bar or elements inside, and force them to be less than 100.
    By the way, this plugin is cool but not maintained and developper seems to not respond to forum...try writting your own custom plugin (like I did), it's quickest, easiest to maintain and way lighter than this one.

  18. vesselds
    Posted 5 years ago #

    Hi dway! Thank you so much for responding. It's unfortunate that we can't get a response from the developer...the very source.

    I not really familiar with WP sites. Actually, this is the first WP site that I have worked with. Where would I find the z-index for the navigation bar? Would this be in the STYLES sheet, or the MENUSM css sheet (the menusm.css works determines the navigation bar styling) or is it a php file? Sorry, I know, lots of questions, I just need a little guidance.

    Again, thank you for your help :)

  19. vesselds
    Posted 5 years ago #

    Hiii! Okay, I figured it out...it was in the MENUSM.css file.
    Thank you so much for your help!


  20. nderambure
    Posted 5 years ago #

    @vesselds : I'm glad you've fixed your bug :)

  21. tyler_durdin
    Posted 4 years ago #

    I'm having a slight problem with this plugin. When I click on an image the lightbox works but for some reason my navigation bar also lights up. Does anybody know how to fix this?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP jQuery Lightbox
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic