• Resolved wouterdoorn

    (@wouterdoorn)


    First of all, thanks for the great plugin!
    I have one question though. The meow gallery js and css load on everypage. Is there a way to only load them on a gallery page?

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter wouterdoorn

    (@wouterdoorn)

    I guess I found the answer, in functions.php I added:

    /**
    * Load Meow gallery on specific pages only
    */
    function meow_deregister_javascript_css() {
    if ( !has_post_format(‘gallery’) ) {
    wp_deregister_script( ‘mgl-js’ );
    wp_deregister_style( ‘mgl-css’ );
    }
    }
    add_action( ‘wp_enqueue_scripts’, ‘meow_deregister_javascript_css’, 100 );

    Plugin Author Jordy Meow

    (@tigroumeow)

    Hi,

    Yes, that’s the way to do it 🙂 However, it will only work with the posts/pages for which the format has been set to “Gallery”. But that doesn’t mean there is actually a gallery, nor the inverse. But yes, that might work in some cases, like yours.

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

The topic ‘js and css load on every page’ is closed to new replies.