Fresh News

How to enable WooCommerce Lightbox support in the theme

Prior to version 3.0 WooCommerce used lightbox support on product detail page by default. It used to show product gallery in a lightbox pop-up to zoom the image. Many themes which are developed and launched before August 2017, either use their own built-in zoom or pop-up scripts or they use the WooCommerce built-in lightbox.

In a case, if you have the theme which was using WooCommerce default lightbox. And you are not able to get the theme updates or theme stopped releasing updates or the theme didn’t fix the issue yet in any update then here a solution for you.

Open a file functions.php in /wp-content/themes/{YOUR-THEME}/functions.php
and paste the following code at the end of the file ( where “YOUR-THEME” will the active theme in your WordPress installation ).

add_action( 'after_setup_theme', 'mytheme_after_setup_theme');
function mytheme_after_setup_theme() {
     add_theme_support('wc-product-gallery-lightbox');
}

Welcome to Wptech. If you’re in search of creative front-end or back-end developer with other creative pros, you’ll find it here. We assemble stylish, Onepage, Multipage, Fully responsive, completely useful Websites and Plugins.

Leave A Comment
*
*