Strip scripts and styles from WP-ecommerce themes

I had to implement some WP-ecommerce themes (download WP-ecommerce), a couple of weeks ago. The admin interface happens to be quite good and simple, butĀ I wanted to build my theme from scratch, controlling the code to a 100%. So all the javascript and css stuff, that automatically gets included, was just a lot of overhead for me.

It took a while to find all the scripts and styles, so I thought sharing here could help someone with the same problem, just add the following lines to your functions.php.

add_action('wp_print_styles','deregister_styles',100);
function deregister_styles() {
	if (!is_admin()) {
		wp_deregister_style('wpsc-thickbox');
		wp_deregister_style('wpsc-theme-css');
		wp_deregister_style('wpsc-theme-css-compatibility');
		wp_deregister_style('wp-e-commerce-dynamic');
	}
}

add_action('wp_print_scripts','deregister_script',100);
function deregister_script() {
	if (!is_admin()) {
		wp_deregister_script('jQuery');
		wp_deregister_script('wp-e-commerce');
		wp_deregister_script('infieldlabel');
		wp_deregister_script('wp-e-commerce-ajax-legacy');
		wp_deregister_script('wp-e-commerce-legacy');
		wp_deregister_script('wp-e-commerce-dynamic');
		wp_deregister_script('livequery');
		wp_deregister_script('wpsc-thickbox');
	}
}

All done. Now we just have to load our own styles and can begin to work on our cleaned up WP-ecommerce themes.

Tagged with:

One thought on “Strip scripts and styles from WP-ecommerce themes

Leave a Reply

Your email address will not be published. Required fields are marked *