This is a Developer level doc. If you are unfamiliar with code/templates and resolving potential conflicts, select a WooExpert or Developer for assistance. We are unable to provide support for customizations under our Support Policy.
functions.php
file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php
file as this will be wiped entirely when you update the theme.
Disable all stylesheets
↑ Back to top
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' ); |
Disable specific stylesheets
↑ Back to top
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Set WooCommerce image dimensions upon theme activation | |
*/ | |
// Remove each style one by one | |
add_filter( 'woocommerce_enqueue_styles', 'jk_dequeue_styles' ); | |
function jk_dequeue_styles( $enqueue_styles ) { | |
unset( $enqueue_styles['woocommerce-general'] ); // Remove the gloss | |
unset( $enqueue_styles['woocommerce-layout'] ); // Remove the layout | |
unset( $enqueue_styles['woocommerce-smallscreen'] ); // Remove the smallscreen optimisation | |
return $enqueue_styles; | |
} | |
// Or just remove them all in one line | |
add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Enqueue your own stylesheet | |
*/ | |
function wp_enqueue_woocommerce_style(){ | |
wp_register_style( 'mytheme-woocommerce', get_template_directory_uri() . '/css/woocommerce.css' ); | |
if ( class_exists( 'woocommerce' ) ) { | |
wp_enqueue_style( 'mytheme-woocommerce' ); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'wp_enqueue_woocommerce_style' ); |