WordPress.org

Support

Support » Plugins and Hacks » Deregister scripts and style on pages that use plugin

Deregister scripts and style on pages that use plugin

  • How do i deregister testimonial-slider on pages it isn’t being used on?

    I’m trying to do something like this in my functions.php

    add_action('wp_head','my_conditional_script',0);
    function my_conditional_script() {
        if (is_front_page() || is_home()) {
            remove_action('init','testimonial_slider_init');
            remove_action('wp_print_styles', 'testimonial_slider_enqueue_styles', 999);
            remove_action('wp_enqueue_scripts', 'testimonial_slider_enqueue_scripts', 999);
            remove_action('wp_head', 'testimonial_slider', 999);
        }
    }

    https://wordpress.org/plugins/testimonial-slider/

  • The topic ‘Deregister scripts and style on pages that use plugin’ is closed to new replies.