• Resolved mattspace

    (@mattspace)


    Wordpress 5.6.8

    I just noticed an issue happening, and I *think* it might be related to the 1.11 update – at least I know I wouldn’t have had the site behaving in this way when I last did work on it, and the 1.11 update shows as 3 weeks ago.

    All my images and image galleries in the Classic Edit block, are failing to trigger the lightbox, opening as just an image directly in the browser window.

    Additionally, when viewing a Category page, I can see in Safari’s web inspector, that the plugin isn’t being loaded. I added the enqueue to the theme’s functions.php, and now it loads every time, but it still wasn’t working for Classic Editor single images. After converting them to blocks it worked fine.

    Was there a change in 1.11 that could mean the plugin’s scope was narrowed, or the detection isn’t working for category posts?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Johannes Kinast

    (@goaroundagain)

    Hi @mattspace,

    Why did you stick with WordPress 5.6.8? I tried it with WordPress 6.0, and the Classic Gallery works fine. There is no support for Classic Images because there is now CSS selector I can use. But you can filter the CSS selector: https://www.ads-software.com/plugins/gallery-block-lightbox/#how%20can%20i%20add%20my%20own%20block%3F%20%2F%20can%20i%20change%20the%20css%20selector%3F and include every image with e.g. .entry-content

    Is there a post with a Gallery/Image at the Category page? Then it should work. Otherwise please provide a link to your category page.

    Thread Starter mattspace

    (@mattspace)

    Hi Johannes,

    Re updating WordPress – I learned it in the 2.x days, when an HTML/CSS designer could comprehend the system by playing around with where the PHP was placed in the HTML – I find the shift to everything being in functions.php files, and programmer-focus makes the product less comprehensible each release – so I don’t upgrade.

    I did some troubleshooting:

    1. The post when viewed singly – classic gallery presence triggers loading the plugin.
    2. However, when the classic gallery post is viewed in a category archive, the plugin isn’t loaded, so the classic gallery links just open the image in the browser window.
    3. Except: IF the most recent / top post in the category has a classic gallery, or linked image block in it, the plugin IS loaded, and all subsequent posts with classic galleries work correctly.

    So it LOOKS to me, like the detection mechanism isn’t evaluating the entire page as displayed when a category archive is being viewed – rather, it’s looking at the first post only, and making a decision based on that.

    I can’t really leave my site in a state that demonstrates the problem with the category trigger, unless we can work out a specific window of time, unfortunately

    So to cause the plugin to open classic editor images, what’s the exact code I should add to my theme’s functions.php?

    Is it:

    add_filter( 'baguettebox_selector', function( $selector ) { return $selector . ',.entry-content'; } )

    ?
    I don’t want every image in a post / page to be in the one lightbox, I want a gallery to have its own lightbox series individual images to be individual lightboxes etc.

    Thanks.

    Plugin Author Johannes Kinast

    (@goaroundagain)

    1. For the detection of the Classic Gallery, we rely on this function: https://developer.www.ads-software.com/reference/functions/get_post_gallery/ I would suggest to just load the Script & style on every page with add_filter( 'baguettebox_enqueue_assets', '__return_true' );

    2. As there is no CSS selector for a Classic Image, I don’t know a way to add a lightbox to just one image.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘1.11 Classic Edit & Category display lightbox broken’ is closed to new replies.