• Hey all,

    Ive been using this plugin for a number of years on a site, and noticed that the captions werent showing correctly at the bottom of the image within the lightbox, and were always saying “untitled” even when a caption is set for the image.

    I dug into the code and realised the default html code the WP gallery generates has changed significantly, hence the plugin code isn’t finding the caption text to display.

    I’ve modified the JS script in the plugin so that it works once again, and if no caption is set for the image it will show the page title instead.

    Simple replace the code in the following file:
    /wp-content/plugins/jquery-lightbox-balupton-edition/scripts/jquery.lightbox.plugin.min.js

    with the following:

    jQuery(function(a){"undefined"!==typeof K2&&new function(){this.updateImageList=function(){a.Lightbox.relify()}};a(".gallery a:has(img)").lightbox(); a("a:not([title]):has(img)").attr("title",function(){var t=$(this).parent().parent().find('.wp-caption-text').eq(0).text(); if(typeof t=='undefined'||t == false){ t=$(document).attr('title');} return t;})});

    Hope this helps anyone else in the same boat – cheers ??

    https://www.ads-software.com/plugins/jquery-lightbox-balupton-edition/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Solution – how to get captions displaying with latest WP’ is closed to new replies.