Goal: Hide product images only on selected product templates (previously hidden siteāwide via CSS).
Proposed approach: Add a Liquid conditional in theme.liquid and wrap the imageāhiding code inside it. Steps: Online Store ā Edit code ā theme.liquid ā insert a condition before :
Multiple templates: The attempted single IF using āandā failed. Suggested solution: use separate IF blocks for each template, e.g.:
{% if template == āproduct.drug-testingā %} ⦠{% endif %}
{% if template == āproduct.dna-testingā %} ⦠{% endif %}
Notes:
Code snippets are central; the exact CSS/markup to remove images is assumed to be the same as the prior siteāwide method, now placed inside the condition(s).
The thread focuses on Liquid condition usage, not on the specific CSS selector to hide images.
Status: Guidance provided on scoping by template and handling multiple templates with separate conditionals. No confirmed resolution from the original poster; key open point is implementing the actual imageāhiding code within those condition blocks.
Summarized with AI on December 23.
AI used: gpt-5.
Is there a code snippet that can remove product images from a defined product template?
Previously we used:
Which removes the product images at the site wide level, I want to be able to display products on defined template now however. Can this be modified to accommodate?
This line of code works, is it able to work on multiple product themes I apply it to? I wrote it like this in the example for the two templates I want to show no product images, however it fails.
{% if template == 'product.drug-testing' and 'product.dna-testing' %}
{% endif %}