WordPress Issue: Lightbox not working in WooCommerce 3.0

WooCommerce 3.0 no longer comes with a gallery feature. This can easily be re-enabled even if your template does not offer a woocommerce gallery option.

Try this:

Backup your entire wordpress website, including files and database. This is always a good practice before making changes.

Simply add the following lines to your after_setup_theme action. (most likely in your functions.php file. I am using the Beaver Builder Child Theme, and although I did not see after_setup_theme, I did see where there was an add_action function. I simply copied and pasted the following code to the bottom of my functions.php , as-is with no modifications. ).

add_action( 'after_setup_theme', 'yourtheme_setup' );

function yourtheme_setup() {
 add_theme_support( 'wc-product-gallery-zoom' );
 add_theme_support( 'wc-product-gallery-lightbox' );
 add_theme_support( 'wc-product-gallery-slider' );
 }

I highly suggest you add a comment to any changes you make to your code, so you can easily find it later in the event of a conflict. For the above, I actually added:

// 2017-10-04 MH: Added code snippet from https://easttexasdesign.com/?p=48326 to fix gallery in WooCommerce 3.0
 add_action( 'after_setup_theme', 'yourtheme_setup' );

function yourtheme_setup() {
 add_theme_support( 'wc-product-gallery-zoom' );
 add_theme_support( 'wc-product-gallery-lightbox' );
 add_theme_support( 'wc-product-gallery-slider' );
 }

About Michelle Hestand

Michelle is a website manager in East Texas. She mainly works on websites related to health, traveling entertainment, and family life.

Leave a Comment