How to hide variant images on a product page using Ella Theme?

Topic summary

A user working with the Ella Theme wants to hide specific variant images from their product page.

A solution was proposed involving:

  • Locating the product-template.liquid file in the code editor
  • Adding conditional markup to exclude images containing ‘variantToExclude’ in their alt text
  • Using a for loop structure with an unless statement to filter out specific variant images

However, the original poster reported that after implementing the suggested code, the images still appear on the page. They included a screenshot showing the issue persists.

The discussion remains unresolved, with the proposed CSS/Liquid code solution not working as intended.

Summarized with AI on November 19. AI used: claude-sonnet-4-5-20250929.

Hello,

I want to hide specific product variant images in my product page, i use Ella Theme.

1 Like

In the code editor, locate the file responsible for rendering the product page. This file is typically named product-template.liquid

To hide specific variant images, you’ll need to add a conditional statement to exclude those images. Modify the code as follows:

{% for image in product.images %}
  {% unless image.alt contains 'VariantToExclude' %}
    
  {% endunless %}
{% endfor %}
1 Like
I added the code but the photo still appears

![Capture d’écran 2023-06-15 à 02.16.55.png|1918x943](upload://emKttX3mFdYRWQ6IxOORIwDUCw7.png)