Shopify themes, liquid, logos, and UX
I have a theme that shows a different logo when a specific customer segment is logged in with specific tags. It shows fine and everything works, then I published a new version of my theme. Everything is still in there with the liquid tags for displayed a different image when the customer has a specific tag, but it stops displaying in my browser for those customers unless they manually clear their cache or open the site and log in via a private/incognito browser window. I don't want this happening everytime I push a new theme edit live.
Why is this happening and how can it be avoided?
During sale periods, I duplicate my existing theme with all the correct code and update a few images here and there so I can sechdule that duplicate to go live for the sale but when it's pushed live - even though all the same coding is in tact for this functionality - it stops working. For context, I'm using the Sleek theme.
This is the custom code snippet to show a different logo based on customer tag:
{% if customer and customer.tags contains 'CUSTOM-catalog' %}
<img
src="custom-catalog-logo.png"
loading="eager"
width="{{ logo_mobile.width }}"
height="{{ logo_mobile.height }}"
alt="{{ logo_mobile.alt | default: shop.name | escape }}"
class="logo header__logo--mobile md:hidden"
style="max-width:250%!important;margin-left:-50px;"
>
{% else %}
<img
srcset="{{ logo_mobile | image_url: width: logo_width_mobile }} 1x, {{ logo_mobile | image_url: width: logo_width_mobile_2x }} 2x"
src="{{ logo_mobile | image_url: width: logo_width_mobile }}"
loading="eager"
width="{{ logo_mobile.width }}"
height="{{ logo_mobile.height }}"
alt="{{ logo_mobile.alt | default: shop.name | escape }}"
class="logo header__logo--mobile md:hidden"
>
{%- endif -%}
Hi,
Hope this will work
- Add a Cache-Busting Trick to Logo URL
Code example (Update your src="custom-catalog-logo.png")
{% if customer and customer.tags contains 'CUSTOM-catalog' %}
<img
src="custom-catalog-logo.png?v={{ 'now' | date: '%s' }}"
loading="eager"
width="{{ logo_mobile.width }}"
height="{{ logo_mobile.height }}"
alt="{{ logo_mobile.alt | default: shop.name | escape }}"
class="logo header__logo--mobile md:hidden"
style="max-width:250%!important;margin-left:-50px;"
>
{% else %}
<img
srcset="{{ logo_mobile | image_url: width: logo_width_mobile }} 1x, {{ logo_mobile | image_url: width: logo_width_mobile_2x }} 2x"
src="{{ logo_mobile | image_url: width: logo_width_mobile }}"
loading="eager"
width="{{ logo_mobile.width }}"
height="{{ logo_mobile.height }}"
alt="{{ logo_mobile.alt | default: shop.name | escape }}"
class="logo header__logo--mobile md:hidden"
>
{% endif %}
Or Use Shopify’s Built-In Image Filters for Dynamic URLs
Or Disable Cache for Authenticated Customers (Advanced)
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025