Answer the question
In order to leave comments, you need to log in
How to remove links to default style files in wordpress/woocomerce?
Hello. Such a story.
There is a wordpress + woocommerce store, I created the theme from scratch, all styles are in a separate css file, BUT default links to default css from woocommerce remain in the header automatically like
woocommerce-layout.css
woocommerce-smallscreen.css
woocommerce.css
And I have them and no, I want to remove these links from the header. How to do this please tell me...
Answer the question
In order to leave comments, you need to log in
immediately found the answer. If anyone needs it, write it in the file function
function wpex_remove_woo_styles( $styles ) {
unset( $styles['woocommerce-general'] );
unset( $styles['woocommerce-layout'] );
unset( $styles['woocommerce-smallscreen'] );
return $styles;
}
add_filter( 'woocommerce_enqueue_styles', 'wpex_remove_woo_styles' );
In themes/<style name>/header.php there you need to understand :3
So everything is written in the docs :
add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question