Created
October 29, 2022 04:21
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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