This topic has 5 replies, 3 voices, and was last updated 9 years, 9 months ago ago by TrueBeardsman
The Second picture on Woocommerce product page is opening in lightbox when you click on it instead of changing the photo in the product page. This just started. Can you offer any advice on fixing it please?
Ex: http://www.truebeardsman.com/shop/forest-haven-beard-oil/ click on the 2nd photo under the picture display and it opens in lightbox instead of chaining the photo in the main display. I don’t want it to open in light box. Lightbox is disabled in woo commerce settings. And Im not talking about the open in lightbox of the theme options either. That is not what is causing it.
Adding the following seems to have resolved the issue.
/* 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', 199 );
?>
I am having this issue also. Where exactly do I paste this code to fix issue?
Hello @Businessbro,
You need add this code in functions.php file in the theme directory.
Thank you.
Regards,
Eva Kemp.
@Businessbro
If you are using a child theme update it in the functions.php of the child theme.
If you are not using a child theme you would want to update the functions.php in the woofers theme folder, however keep in mind when you update woofers next time the functions.php will be overwritten. It’s better to use a child theme if you are going to be customizing any of the theme files, ie. css, functions.php etc.
You must be logged in to reply to this topic.Log in/Sign up