Remove WooCommerce styles and scripts

Remove WooCommerce default css and js of lightbox then implement any plugins like:-

  1. Twist – Woocommerce Product Gallery Slider
  2. Responsive Lightbox

 

/* Remove WooCommerce styles and scripts. */
function woo_remove_lightboxes() {

// Styles
wp_dequeue_style( ‘woocommerce_prettyPhoto_css’ );

// Scripts
wp_dequeue_script( ‘prettyPhoto’ );
wp_dequeue_script( ‘prettyPhoto-init’ );
wp_dequeue_script( ‘fancybox’ );
wp_dequeue_script( ‘enable-lightbox’ );
}

add_action( ‘wp_enqueue_scripts’, ‘woo_remove_lightboxes’, 99 );

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s