• Resolved cattoraytube

    (@cattoraytube)


    Thank you for this plugin – looks like it’s being very well received so far and you’re super fast with support, which is wonderful!
    I have an issue with native Gutenberg galleries where, despite this being installed and the link location being set to the source file as instructed, clicking the images simply loads the source file instead of the lightbox.
    This is a multisite setup, but apart from that I can’t figure out what might be the issue. I’ve cleared caches and everything multiple times while testing, and the Firefox Developer console isn’t showing any errors stemming from this plugin.

    The page I need help with: [log in to see the link]

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

    (@goaroundagain)

    Hi @cattoraytube,

    The script and style are not loading on that page. You can try to load the script & style everywhere for a test. Just add this to your functions.php:

    function my_theme_enqueue_baguettebox_assets() {
    	wp_enqueue_script( 'baguettebox' );
    	wp_enqueue_style( 'baguettebox-css' );
    }
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_baguettebox_assets' );

    A multisite should be not the issue. I run the plugin just fine on mine.

    What does https://freepress.network/an8/www/delivery/asyncjs.php do? Is this any JavaScript optimization tool?

    Plugin Author Johannes Kinast

    (@goaroundagain)

    @cattoraytube I just noticed that you can see the folder structure on https://freepress.network Check your webserver configuration.

    I now understand what https://freepress.network/an8/www/delivery/asyncjs.php does (Ad Server). Should not be the issue.

    Thread Starter cattoraytube

    (@cattoraytube)

    Thank you for all of that Johannes! I’ve fixed the freepress.network folder structure issue – I appreciate the effort you went to to find out what that js did and to point out the domain structure was visible!

    I’ve tried adding that code to my functions.php with no success. Is there somewhere specific I should be putting that in the functions file, or is with other enqueues okay?

    Plugin Author Johannes Kinast

    (@goaroundagain)

    Hi @cattoraytube,

    Strange! Are you sure the plugin is active on that site? Could you try to active it for all sites?

    Could you try to disable LiteSpeed Cache? What other plugins do you have installed?

    Thread Starter cattoraytube

    (@cattoraytube)

    Thanks again Johannes!

    Plugin is network activated and I can’t see any additional action I need to take to enable it on the MELMAG site – is that correct?

    I did try disabling LiteSpeed the other day, but no luck. I’ve also just tried disabling all plugins (including LiteSpeed) except this one, removing all custom js/jquery, and flushing caches from within cPanel to no avail.

    Other plugins are working, though no lightbox one seems to. I very, very much doubt so, but is there a risk the CSS styling I have for the gallery block could be interfering?

    Thread Starter cattoraytube

    (@cattoraytube)

    Oh, and re: other sites. Just tried the block editor on another site with a completely different theme and having the same issue. I’m going to double check plugins across the sites.

    Thread Starter cattoraytube

    (@cattoraytube)

    Update!
    I manually integrated baguettebox into the theme using the files in /dist/ in your plugin and the suggested invocation code on the baguettebox github. The invocation code is:

            <link rel="stylesheet" href="<?php echo get_template_directory_uri() ?>/inc/gallery-block-lightbox/dist/baguetteBox.min.css">
            <script src="<?php echo get_template_directory_uri() ?>/inc/gallery-block-lightbox/dist/baguetteBox.min.js" async></script>
            <script>
                window.addEventListener('load', function() {
                  baguetteBox.run('.wp-block-gallery');
                });
            </script>

    The interesting part of this code is, because the listener waits for the page to load, if you click an image before the page has completed loading it will just follow to the source URL. Page loads were completing before, but I’m wondering if some of the things I was trying were false negatives because I wasn’t waiting for the page to finish loading.

    Still keen to work with you to figure out what was going on with the plugin, if you don’t think that was something entirely at my end.

    Plugin Author Johannes Kinast

    (@goaroundagain)

    Hi @cattoraytube,

    Yesterday the script and style for baguettBox.js doesn’t load on your page. Now it’s working because the script & style are loading correctly.

    We have to wait for the load event because we must be sure that the baguettBox.js script is loaded. That should not be the issue.

    Thread Starter cattoraytube

    (@cattoraytube)

    Well, yes – it’s working today because I manually implemented the script and style in the site theme and disabled the plugin.

    Plugin Author Johannes Kinast

    (@goaroundagain)

    Strange, without access to your WordPress instance, I can’t figure out what’s the problem here. Sorry.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Clicking images loading source instead of lightbox’ is closed to new replies.