Skip to content

Instantly share code, notes, and snippets.

@corsonr
Last active June 20, 2018 07:17
Show Gist options
  • Save corsonr/332ed789d2db55a96028e89dfefd59df to your computer and use it in GitHub Desktop.
Save corsonr/332ed789d2db55a96028e89dfefd59df to your computer and use it in GitHub Desktop.
Disable WooCommerce 3.+ lightbox
<?php // Do not include this if already open! Code goes in theme functions.php.
add_action( 'after_setup_theme', 'remove_wc_gallery_lightbox', 100 );
function remove_wc_gallery_lightbox() {
remove_theme_support( 'wc-product-gallery-lightbox' );
}
@SuzanaSp
Copy link

when I put it at the bottom, I get this message:

Your PHP code changes were rolled back due to an error on line 908 of file wp-content/themes/Holly_Theme/functions.php. Please fix and try saving again.

syntax error, unexpected '<', expecting end of file

@xlarin
Copy link

xlarin commented Jun 20, 2018

Add only:

add_action( 'after_setup_theme', 'remove_wc_gallery_lightbox', 100 );
function remove_wc_gallery_lightbox() {
remove_theme_support( 'wc-product-gallery-lightbox' );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment