• Resolved jurajj

    (@jurajj)


    Hi,
    I’m trying to remove all JS and CSS files on unwanted pages. This is not working for me (example) :

    function theme_enqueue_styles() {
    	if ( ! is_archive() ) {
    		wp_dequeue_style( 'woof-css' );
    		// other scripts/styles here
    	}
    }
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );

    I just want to fire all stuff only on archive with loop of product and sidebar with filters.
    Client’s website is loading very very slowly because of a lots of unnecessary stuff.
    Thank you.

    • This topic was modified 4 years, 5 months ago by jurajj.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove all scripts and styles on unwanted pages’ is closed to new replies.