Unwanted dequeuing of styles and scripts on product category / product taxonomy
-
For SEO Reasons I dequeue WooCommerce Styles and Scripts outside of the WooCommerce Shop with the following script in functions.php:
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); function child_manage_woocommerce_styles() { //remove generator meta tag remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); //first check that woo exists to prevent fatal errors if ( function_exists( 'is_woocommerce' ) ) { //dequeue scripts and styles if ( !is_woocommerce() && !is_shop() && !is_product_category() && !is_product_tag() && !is_product() && !is_cart() && !is_checkout() && !is_account_page() && !is_wc_endpoint_url() ) { wp_dequeue_style( 'woocommerce-layout' ); wp_dequeue_style( 'woocommerce-smallscreen' ); wp_dequeue_style( 'woocommerce-general' ); wp_dequeue_script( 'wc-add-to-cart' ); wp_dequeue_script( 'wc-cart-fragments' ); wp_dequeue_script( 'woocommerce' ); wp_dequeue_script( 'jquery-blockui' ); wp_dequeue_script( 'jquery-placeholder' ); } } }
However I am not able to identify the taxonomy or category pages with these conditional tags. If I deactivate the add_action call the taxonomy page works fine as it doesn’t dequeue the styles and scripts.
Is there an other conditional tag to identify taxonomy or product category pages?
The page I need help with: [log in to see the link]
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Unwanted dequeuing of styles and scripts on product category / product taxonomy’ is closed to new replies.