Turn Off Product Image Zoom, Lightbox or Slider
Disables the hover zoom, the full-screen lightbox and/or the thumbnail slider of the WooCommerce product gallery.
Opens WPIDE on
Code
add_action( 'after_setup_theme', function () {
$keep = array(
'wc-product-gallery-zoom' => false, // Hover zoom.
'wc-product-gallery-lightbox' => true, // Full-screen lightbox.
'wc-product-gallery-slider' => true, // Thumbnail slider.
);
foreach ( $keep as $feature => $enabled ) {
if ( ! $enabled ) {
remove_theme_support( $feature );
}
}
}, 100 );
Notes
Set each feature to true to keep it or false to turn it off.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.