Skip to content

Instantly share code, notes, and snippets.

@elias1435
Created October 29, 2022 04:21
Show Gist options
  • Save elias1435/f0fa273250392f0dd281602164ced58b to your computer and use it in GitHub Desktop.
Save elias1435/f0fa273250392f0dd281602164ced58b to your computer and use it in GitHub Desktop.
disabling the lightbox on WooCommerce Single product image. use this code in your child theme functions.php
function custom_single_product_image_html( $html, $post_id ) {
$post_thumbnail_id = get_post_thumbnail_id( $post_id );
return get_the_post_thumbnail( $post_thumbnail_id, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ) );
}
add_filter('woocommerce_single_product_image_thumbnail_html', 'custom_single_product_image_html', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment