• Resolved marsch

    (@marsch)


    Hi,

    I’ve tried to disable the lightbox from loading on mobile using the following code. Unfortunately, it doesn’t work. What am I missing?

    Thank you

    function disable_lightbox_on_mobile() {
        if ( wp_is_mobile() ) {
            wp_dequeue_style( 'leaflet-css' );
            wp_dequeue_script( 'mwl-build-js' );
        }
    }
    
    add_action( 'wp_enqueue_scripts', 'disable_lightbox_on_mobile', 100 );
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Val Meow

    (@valwa)

    Hey @marsch ! ??

    I’ve tested your code, and it works just fine. Please ensure that there is no cache on the mobile device (and on your WordPress site) from which you are testing, as the lightbox script might still be lingering there. ??

    Thread Starter marsch

    (@marsch)

    You were right! That was the issue! Thanks for looking into this.

    Where I should put this code to work?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Disable lightbox on mobile?’ is closed to new replies.