Hide Cart Icon on Blog and Home Pages - Only show on product and shop pages

What is the best practice for hiding the cart icon for hompages, news and blog pages and only show it on product and shopping pages? I’m using the following to hide from my homepage but how do I select all non-product and shop pages, is there a not function?

{% if template.name == 'index' %}

{% endif %}
1 Like

@maslerdanch hey, thanks for posting here.
can you please share the link to inspect it, thanks.

https://www.heathkane.co.uk/

Hi @maslerdanch

Please add this code to theme.liquid file

{% if template == 'index' or template.name == 'blog' or template.name == 'article' %}
 
{%- endif -%}
1 Like

Thanks Dan - that’s great!