WordPress.org

Ready to get started?Download WordPress

Forums

Meteor Slides
Meteor Slides - Load CSS/Scripts only on Home Page (2 posts)

  1. zvhipp
    Member
    Posted 3 years ago #

    hello,

    I use meteor slides only on my home page. I want to know if there is any way to disable css/js/javascript related to this plugin in header from other pages except home page - where it's being displayed on.

    Thank you.

  2. Josh Leuze
    Member
    Plugin Author

    Posted 3 years ago #

    Hi, to do this you would specify what page you wanted to load it on and remove the actions from running on any other page.

    Here is a bit of code you could drop into your theme's functions.php file to remove the scripts from all but the front page:

    add_action( 'get_header', 'remove_meteorslides_scripts' );
    
    function remove_meteorslides_scripts() {
    
    	if ( !is_front_page() ) {
    
    		remove_action( 'wp_print_scripts', 'meteorslides_javascript' );
    
    		remove_action( 'wp_enqueue_scripts', 'meteorslides_css' );
    
    	}
    
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic