Lightbox not working any more? Try this fix..
-
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 usesfigure/div/figcaption
instead ofdl/dt/dd
for gallery html.The problem is in file
gallery-lightbox-slider/inc/functions/glg-functions.php
, the plugin looks fordt
but not fordiv
.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.
- The topic ‘Lightbox not working any more? Try this fix..’ is closed to new replies.