 passatgt
|
Hi!
I need a really simple shop and i want to create a custom theme. How can i remove all of the wpsc js and css files from the <head> tag?
I found this, but this is only remove the thickbox of course.
add_action( 'init', 'my_deregister_stuff', 100 );
function my_deregister_stuff() {
wp_deregister_style( 'wpsc-thickbox' );
wp_deregister_script( 'wpsc-thickbox' );
}
I need to get rid of all js and css files. Any idea?
|
 passatgt
|
Ok, i found a solution, i just need to add all of these inside de my_deregister_stuff:
wp_deregister_style( 'wpsc-theme-css' );
wp_deregister_style( 'wpsc-theme-css-compatibility' );
wp_deregister_style( 'wpsc-product-rater' );
wp_deregister_style('wp-e-commerce-dynamic');
wp_deregister_style( 'wpsc-thickbox' );
wp_deregister_script( 'wpsc-thickbox' );
wp_deregister_script('jquery-rating');
wp_deregister_script( 'wp-e-commerce' );
wp_deregister_script( 'jQuery' );
wp_deregister_script( 'infieldlabel' );
wp_deregister_script( 'wp-e-commerce-ajax-legacy' );
wp_deregister_script( 'wp-e-commerce-dynamic' );
wp_deregister_script( 'livequery' );
wp_deregister_script( 'wp-e-commerce-legacy' );
wp_deregister_script( 'l10n' );
remove_action('wp_head', 'wpsc_product_list_rss_feed');
|
 cannobbio
|
Hey!, cool post.
It’s very annoying to have all those stylesheets to override when you want something simple.
You could also add to the list:
wp_deregister_style( 'wpsc-gold-cart' );
EDIT:
Oops! it doesn’t work.
How do I remove this?:
<link rel='stylesheet' id='wpsc-gold-cart-css' href='xxx/wp-content/plugins/gold_cart_files_plugin/css/gold_cart.css?ver=3.1.1' type='text/css' media='all' />
and this:
<script type='text/javascript' src='xxx/wp-content/plugins/gold_cart_files_plugin/js/gold_cart.js?ver=3.1.1'></script>
|
 cannobbio
|
// Remove Styles
function childtheme_deregister_styles() {
wp_deregister_style( 'wpsc-theme-css' );
wp_deregister_style( 'wpsc-theme-css-compatibility' );
wp_deregister_style( 'wpsc-product-rater' );
wp_deregister_style( 'wp-e-commerce-dynamic');
wp_deregister_style( 'wpsc-thickbox' );
wp_deregister_style( 'wpsc-gold-cart' );
}
add_action( 'wp_print_styles', 'childtheme_deregister_styles', 100 );
// Remove Scripts
function childtheme_deregister_scripts() {
wp_deregister_script( 'wpsc-thickbox' );
wp_deregister_script( 'jquery-rating' );
wp_deregister_script( 'wp-e-commerce' );
wp_deregister_script( 'jQuery' );
wp_deregister_script( 'infieldlabel' );
wp_deregister_script( 'wp-e-commerce-ajax-legacy' );
wp_deregister_script( 'wp-e-commerce-dynamic' );
wp_deregister_script( 'livequery' );
wp_deregister_script( 'wp-e-commerce-legacy' );
wp_deregister_script( 'l10n' );
wp_deregister_script( 'wpsc-gold-cart' );
}
add_action( 'wp_print_scripts', 'childtheme_deregister_scripts', 100 );
// Remove Product List RSS
remove_action('wp_head', 'wpsc_product_list_rss_feed');
|
 Draconis
New Member
|
Where exactly does this get inserted?
|
 Roy Ho
Resident Expert Trusted
|
In your functions.php file of your active WP theme.
|
 Draconis
New Member
|
cool, thanks Roy, that helps a great deal finding a conflict.
|
 lorax
|
I still had some code left over for Gold Cart which I was able to remove using:
remove_action('wp_head', 'gold_shpcrt_javascript', 20);
|