Hello, I would like to delete the first image of my photo gallery because it is not the same size as the others.
I tried to integrate the following 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;
}
However the functionality that selects the image corresponding to the variation does not work anymore.
How can I delete the first image while keeping the function that selects the images according to the variation?