Skip to content

Instantly share code, notes, and snippets.

@woogists
Last active September 14, 2022 14:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save woogists/1f779d37ecfda7fae76ce22b513fa4b6 to your computer and use it in GitHub Desktop.
Save woogists/1f779d37ecfda7fae76ce22b513fa4b6 to your computer and use it in GitHub Desktop.
[Theming Snippets] Disable specific stylesheets
/**
* 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' );
@lomars
Copy link

lomars commented Jan 4, 2021

Not Working anymore in WooCommerce 4.x+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment