Remove featured image from product page
-
Hi there,
I need a little help with my single product page.
I want to display the feature product image on the shop/category page, but on the single product page, I don′t want to display the feature product.I found this code
add_filter('woocommerce_single_product_image_thumbnail_html', 'remove_featured_image', 10, 2); function remove_featured_image($html, $attachment_id ) { global $post, $product; $featured_image = get_post_thumbnail_id( $post->ID ); if ( $attachment_id == $featured_image ) $html = ''; return $html; }
From this topic:
https://www.ads-software.com/support/topic/remove-featured-image-from-product-page-gallery/But I can′t resolve the issue with the gallery on the single product page.
When using this code, the feature product image disappears from the single product page, but it leaves a blank space where the feature product thumbnail should be. And also, when clicking the blank space, it brings the first image of the gallery, and when clickig the second thumbnail, it brings the third image.
And btw, I use variation products.Does anyone know how to resolve this issue?
Thanks a lot!regrads,
JennThe page I need help with: [log in to see the link]
- The topic ‘Remove featured image from product page’ is closed to new replies.