#126808 Remove featured image from product gallery

Landing Forums JupiterX WordPress Theme Remove featured image from product gallery

Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • Jennifer

    Hello, I’d like to remove the ‘featured image’ from the single product image gallery please. How can I do this?

    Thanks

    Alexander Hutsol Support Team

    Hello,

     

    Please provide the page URL where you want to remove the featured image and share WP Dashboard credentials in the private reply.

     

    Thank you.

    Regards.

    Private
    Jennifer
    This reply has been marked as private.
    Nodari Support Team

    Hi Jen

    Try this code and let me know if it worked like you want:

    .woocommerce div.product div.woocommerce-product-gallery .woocommerce-product-gallery__image {
        border: none !important;
    }
    .woocommerce div.product div.woocommerce-product-gallery .woocommerce-product-gallery__image img {
        display: none;
    }

    Please also note, this code will hide images from all your single product pages

    Regards

    Jennifer

    Hi Nodari,

    Sorry I should have been more specific. I want to lose the ‘featured image’, but keep the gallery – the client wants other photos and videos to display by the products.

    Is that possible?

    Thanks

    Alexander Hutsol Support Team

    Hello,

     

    Please add this code in Customizer > Additional CSS:

    .woocommerce:not(.jupiterx-product-template-9):not(.jupiterx-product-template-10) div.product div.woocommerce-product-gallery .flex-viewport {
    display: none;
    }

     

    Regards.

    Jennifer

    Hi Alexander,

    So that’a hiding the image box completely, leaving just the gallery thumbnails visible, but you can’t view the other images / videos.

    Tatyana Hutsol Support Team

    Hello,

     

    Please try adding this code in the functions.php file:

    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;
    }

    It’s better if you install the child theme and add the code in the child theme functions.php file so the changes aren’t lost after the theme update.

     

    Regards.

    Jennifer

    Hi Tatyana,

    Great tip, I didn’t realise I wasn’t using the child theme. I will switch over.

    However the code doesn’t seem to have done the trick. It’s just removed the product image and gallery completely. Any other ideas?

    Private
    Alexander Hutsol Support Team
    This reply has been marked as private.
    Private
    Jennifer
    This reply has been marked as private.
    Private
    Mohsin Al-Rabieai Support Team
    This reply has been marked as private.
    Private
    Alexander Hutsol Support Team
    This reply has been marked as private.
    Jennifer

    Hello, those IPs have been added. Please try again 🙂

    Private
    Jennifer
    This reply has been marked as private.
    Private
    Jennifer
    This reply has been marked as private.
    Mohsin Al-Rabieai Support Team

    Hi Jennifer,

    Sorry, I but I believe my colleague Tatyana is working properly based on what you described. See this is all related to WooCommerce. If you search for “woocommerce remove featured image but keep the gallery” in google, you will see pretty much similar workarounds. You want to keep the gallery while removing the featured image. You may also check this Q/A in SO:

    https://stackoverflow.com/questions/44732859/remove-featured-image-from-the-woocommerce-gallery

    Best regards

    Jennifer

    Thanks, I managed to get it working, I think!

    Amir Rather Support Team

    Glad to hear that 🙂

Viewing 19 posts - 1 through 19 (of 19 total)
You must be logged in to reply to this topic.
Login