• Lightboxes on some sites did not work any more after recent WP and/or plugin and/or theme updates.

    Did some research and it turns out that current Gallery Lightbox 1.0.0.31 looks for galleries with older but not with newer html5 markup.

    If your theme now does something like add_theme_support( 'html5', array('gallery') ); the gallery shortcode uses figure/div/figcaption instead of dl/dt/dd for gallery html.

    The problem is in file gallery-lightbox-slider/inc/functions/glg-functions.php, the plugin looks for dt but not for div.

    Current code:

    $('.gallery, .ghozylab-gallery, .wp-block-gallery')
    	.photobox('.carousel-item:not(".bx-clone") > a:not(".icp_custom_link"),a.glg-a-custom-wrap, .gallery-item > dt > a',{
    

    Suggested fix, add , .gallery-item > div > a in line 139:

    $('.gallery, .ghozylab-gallery, .wp-block-gallery')
    	.photobox('.carousel-item:not(".bx-clone") > a:not(".icp_custom_link"),a.glg-a-custom-wrap, .gallery-item > dt > a, .gallery-item > div > a',{
    

    That did the trick here in all reported cases.

    Thanks for the plugin.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author GhozyLab

    (@ghozylab)

    Hi @ov3rfly,

    Thank you for your contribution, we will apply in the next release ??

    Thank you so much for this fix, @ov3rfly – my galleries are working again ?? !

    murray654

    (@murray654)

    @GhozyLap: I just tried the plugin (published 1 week ago) and the above solution (7 weeks ago) is still necessary. Am I missing something? Thanks for the plugin!

    Hi @ghozylab !

    The latest update (version 1.0.0.33) broke the fix ??

    I had to re-apply the fix to version 1.0.0.33 to make it work again…

    PS : It’s a really nice plugin ??

    Plugin Author GhozyLab

    (@ghozylab)

    Dear All,

    We are sorry for this issue, we just applied patch suggested by @ov3rfly, thank you very much ??

    Recent update here

    Strange, I still need to edit line 144 :

    Before:
    .photobox('.carousel-item:not(".bx-clone") > a:not(".icp_custom_link"),a.glg-a-custom-wrap, .gallery-item > dt > a, .gallery-item > div > a',{

    After:
    .photobox('.carousel-item:not(".bx-clone") > a:not(".icp_custom_link"),a.glg-a-custom-wrap, .gallery-item > dt > a, .gallery-item > div > a, .blocks-gallery-item > figure > a',{

    Maybe thats because of my theme?

    • This reply was modified 4 years, 10 months ago by murray654.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Lightbox not working any more? Try this fix..’ is closed to new replies.