yanknudtskov
1/4/2014 - 1:32 PM

Remove WooCommerce Styles and Scripts From http://gregrickaby.com/remove-woocommerce-styles-and-scripts/

Remove WooCommerce Styles and Scripts From http://gregrickaby.com/remove-woocommerce-styles-and-scripts/

add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );

/** 
* Remove WooCommerce Generator tag, styles, and scripts from the homepage.
* Tested and works with WooCommerce 2.0+ 
* @author Greg Rickaby @since 2.0.0 
*/

function child_manage_woocommerce_styles() 
{	
  remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
  
  if ( is_front_page() || is_home() )
  {	
      wp_dequeue_style( 'woocommerce_frontend_styles' );
      wp_dequeue_style( 'woocommerce_fancybox_styles' );
      wp_dequeue_style( 'woocommerce_chosen_styles' );
      wp_dequeue_style( 'woocommerce_prettyPhoto_css' );
      wp_dequeue_script( 'wc_price_slider' );
      wp_dequeue_script( 'wc-single-product' );
      wp_dequeue_script( 'wc-add-to-cart' );	
      wp_dequeue_script( 'wc-cart-fragments' );
      wp_dequeue_script( 'wc-checkout' );	
      wp_dequeue_script( 'wc-add-to-cart-variation' );	
      wp_dequeue_script( 'wc-single-product' );	
      wp_dequeue_script( 'wc-cart' );	
      wp_dequeue_script( 'wc-chosen' );	
      wp_dequeue_script( 'woocommerce' );	
      wp_dequeue_script( 'prettyPhoto' );	
      wp_dequeue_script( 'prettyPhoto-init' );
      wp_dequeue_script( 'jquery-blockui' );	
      wp_dequeue_script( 'jquery-placeholder' );
      wp_dequeue_script( 'fancybox' );	
      wp_dequeue_script( 'jqueryui' );
    }
}