Deregister script / remove action if not on front page
-
http://wordpress.org/plugins/simple-responsive-slider/
Hello, thanks for the great plugin.
I am trying to remove the scripts from other pages except for the front page. The first part, deregstering the .js file works fine, but the second, removing the action from wp_head does not.
Any ideas? What am I missing?
Thank you in advance.add_action( 'wp_print_scripts', 'mw_deregister_javascript'); function mw_deregister_javascript() { if ( !is_front_page() ) { wp_deregister_script( 'responsiveslides' ); } } add_action( 'wp_head', 'mw_remove_actions'); function mw_remove_actions() { if ( !is_front_page() ) { global $simple_responsive_slider; remove_filter( 'wp_head', array($simple_responsive_slider, 'dynamics_scripts') ); } }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Deregister script / remove action if not on front page’ is closed to new replies.