• Resolved jenndigital

    (@jenndigital)


    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,
    Jenn

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Margaret S. woo-hc

    (@margaretwporg)

    Hi @jenndigital

    Thanks for reaching out.

    Glad you performed some search already and tried the code above.

    In order to Remove the featured image can you please apply the following custom CSS. Under Appearance > Customize > Additional CSS, you can add the following code:

    .page-slideshow {
    display: none !important;
    }

    I hope this helps!

    Thread Starter jenndigital

    (@jenndigital)

    Hi @margaretwporg ,

    Thanks for the reply.
    I tried this css code but unfortunately is not working as expected.

    Thanks anyways.
    I am still trying to find a solution.

    kind regards,
    Jenn

    Margaret S. woo-hc

    (@margaretwporg)

    Hi @jenndigital

    Apologies for the delay here.

    There is a similar thread on this topic: https://www.ads-software.com/support/topic/how-to-remove-featured-image-from-page-or-post/

    Can you please try the solutions described on the thread to see if those work for you?

    Thanks

    Margaret S. woo-hc

    (@margaretwporg)

    We haven’t heard back from you in a while, so I’m going to mark this thread as resolved – we’ll be here if and/or when you are ready to continue.

    Thread Starter jenndigital

    (@jenndigital)

    Hi Margaret,

    Sorry for the late reply.
    I havent been able to fix the issue.
    Seems that the original code actually works, but there is something with the theme template that won′t make it work as it should.

    Thanks for the help!

    Hi @jenndigital!

    That’s great! We are glad you were able to solve the issue ??

    Thanks for keeping us posted. If you have any further questions, we recommend creating a new topic.

    Cheers!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Remove featured image from product page’ is closed to new replies.