Skip to content

Instantly share code, notes, and snippets.

@Pushplaybang
Created January 29, 2014 14:23
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save Pushplaybang/d4a57a5f87695c403160 to your computer and use it in GitHub Desktop.
Save Pushplaybang/d4a57a5f87695c403160 to your computer and use it in GitHub Desktop.
#WordPress #WooCommerce - remove shitty pretty photo lightbox
//Remove prettyPhoto lightbox
add_action( 'wp_enqueue_scripts', 'fc_remove_woo_lightbox', 99 );
function fc_remove_woo_lightbox() {
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
wp_dequeue_style( 'woocommerce_prettyPhoto_css' );
wp_dequeue_script( 'prettyPhoto' );
wp_dequeue_script( 'prettyPhoto-init' );
}
//Add fancyBox lightbox - if thats what you want.
add_action( 'wp_enqueue_scripts', 'fc_add_fancybox' );
function fc_add_fancybox() {
wp_enqueue_script( 'fancybox', get_stylesheet_directory_uri() . '/js/fancybox/jquery.fancybox.pack.js', false );
wp_enqueue_style( 'fancybox-style', get_stylesheet_directory_uri() . '/js/fancybox/jquery.fancybox.css' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment