Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove Wordpress WooCommerce StoreFront Header Styles

The Wordpress WooCommerce StoreFront Theme queues styles in the header from the WooCommerce StoreFront Customiser;

<style id='storefront-woocommerce-style-inline-css' type='text/css'></style>
<style id='storefront-style-inline-css' type='text/css'></style>

I seem to spend more time over-righting these styles, than defining what I want. Does anyone know how to remove them or disable the Storefront customiser?

Header Styles

like image 208
Stuart Avatar asked May 16 '16 20:05

Stuart


3 Answers

For anyone that is fighting with this, this is the solution I found:

function my_theme_remove_storefront_standard_functionality() {

//remove customizer inline styles from parent theme as I don't need it.
set_theme_mod('storefront_styles', '');
set_theme_mod('storefront_woocommerce_styles', '');  

}

add_action( 'init', 'my_theme_remove_storefront_standard_functionality' );
like image 185
Lautaro Rosales Avatar answered Oct 19 '22 11:10

Lautaro Rosales


The two of inline CSS was added in class-storefront-customizer.php.

For deregister storefront-style-inline-css:

add_filter('storefront_customizer_css', '__return_false');

For deregister storefront-woocommerce-style-inline-css:

add_filter('storefront_customizer_woocommerce_css', '__return_false');
like image 33
Nel Tseng Avatar answered Oct 19 '22 10:10

Nel Tseng


I had to remove these recently, and the best way to do it is using Ngoc Nguyen's method.

Just put the below code in your functions.php

function wpcustom_deregister_scripts_and_styles(){
    wp_deregister_style('storefront-woocommerce-style');
    wp_deregister_style('storefront-style');
}
add_action( 'wp_print_styles', 'wpcustom_deregister_scripts_and_styles', 100 );
like image 6
Jalapeno Jack Avatar answered Oct 19 '22 09:10

Jalapeno Jack