Make announcement bar to be visible only on homepage

Topic summary

Goal: Show the Shopify Dawn theme’s announcement bar only on the homepage.

Working solution:

  • Edit theme.liquid, locate the line rendering the announcement bar: {% section ‘announcement-bar’ %}.
  • Wrap it in a Liquid condition that checks the homepage path: “{% if request.path == ‘/’ %}{% section ‘announcement-bar’ %}{% endif %}”.
  • This uses Shopify Liquid and the request.path variable to render the bar only at the root URL.

Alternate suggestion:

  • A conditional using template.name was proposed but provided without wrapping the section and would not achieve the desired behavior as shared.

Outcome and validation:

  • A participant confirmed the path-based conditional worked.
  • Images were provided to show the exact code location in theme.liquid.

Status:

  • Appears resolved with a clear, actionable edit; awaiting original poster’s confirmation but no further issues reported.
Summarized with AI on January 5. AI used: gpt-5.

Hi,

I would like my announcement bar to be visible only on my homepage (www.sugarfreeeu.com), does anyone know how can I make it happen ? dawn theme

thank you in advance !

1 Like

Hello There,

  1. In your Shopify Admin go to online store > themes > actions > edit code
  2. Find layout >theme.liquid and paste this at the bottom of the file:
{% if template.name != 'index' %}

{% endif %}
1 Like

Hi @Eli90

You can follow this suggestion

Go to theme => edit code, then find the “{% section ‘announcement-bar’ %}” in the theme.liquid file:

then you edit the above code to the following code: “{% if request.path == “/” %} {% section ‘announcement-bar’ %}{% endif %}”

This worked for me thanks.

1 Like

Thank you for your response. It’s good to know that it’s worked for you. Kindly feel free to get back to me if you need any further assistance.
If helpful then please Like and Accept Solution.