Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter bro007

    (@bro007)

    Thank you for your attention 🙂 Yesterday I found a function with which I achieved the desired result, and also removed other styles on my site with its help:

    function disable_scripts_styles(){
    if ( !is_single() ) {
    wp_dequeue_style( ‘baguettebox-css’ );
    wp_dequeue_script( ‘baguettebox’ );
    }
    }
    add_action( ‘wp_enqueue_scripts’, ‘disable_scripts_styles’, 99 );

    Might be useful for someone… Thank you, your lightbox plugin is the best!

    Thread Starter bro007

    (@bro007)

    I wrote about the fact that it would be nice if the plugin added scripts and styles, only where there are galleries. I have them in posts, and the plugin adds them more: in archives, on panigation pages. This is what I meant … (although this is not critical).

    Thread Starter bro007

    (@bro007)

    When adding: add_filter( ‘baguettebox_enqueue_assets’, ‘__return_true’ ); – everything remains as it is (all scripts and plugin styles are also displayed on all pages, that is, nothing changes). I need them to be displayed only in posts (I have galleries in posts).

Viewing 3 replies - 1 through 3 (of 3 total)