• Resolved bitma

    (@bitma)


    I would like the product image to be included in the product gallery, but not initially displayed as the first featured image.

    This is as far as I have been able to come. It shows a different featured image and includes the product image in the thumbnails but when you click on it the other image is shown as the featured image .

    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;

    }

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Support Kaushik S. a11n

    (@kaushiksomaiya)

    Hi there @bitma

    Thanks for contacting us! ??

    I tested snippet and it seems to be totally removing the featured image. You’ve mentioned you want to include the featured image in gallery but not as the first one – does this mean the featured image should come on second or later position and the first immediate gallery image should be shown in place of featured image?

    It would be great to have some more clarity regarding your goals.

    We look forward to hearing from you!

Viewing 1 replies (of 1 total)
  • The topic ‘Change featured image in product gallery’ is closed to new replies.