Shopify themes, liquid, logos, and UX
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
I'd like to remove the header announcement bar from my product page only.
https://intothesauce.com.au/products/dinner-party-conversation-cards
This is the Dawn theme.
Thanks!
Solved! Go to the solution
This is an accepted solution.
Hi @saucyware,
You need to do this in the theme.liquid under the Layout folder in the code editor.
Open the theme.liquid and find the announcement-bar section. Enclose the code like the code below.
{% if template.name != "product" %} {% section "announcement-bar" %} {% endif %}
CSS based customization.
In the theme designer on the product template page create a custom-liquid section and add the following style:
<style>#shopify-section-announcement-bar { display: none; } </style>
You will want to make note in your documentation you've done this so it's not forgotten about down the road.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
This is an accepted solution.
Hi @saucyware,
You need to do this in the theme.liquid under the Layout folder in the code editor.
Open the theme.liquid and find the announcement-bar section. Enclose the code like the code below.
{% if template.name != "product" %} {% section "announcement-bar" %} {% endif %}
Thank you, this worked 🙂
Hi, can you elaborate what do you mean by enclosing the code like the code below? I found the announcement bar section, but I'm not sure how to implement this code. I tried pasting it at the top, bottom, and nested, and I can't seem to get it to work. Thanks!
I'm using Dawn
Hi @bbry,
If you found the section code. It should look like below
{% section "announcement-bar" %}
You need to enclose it in the "if statement", then your code should look like below
{% if template.name != "product" %}
{% section "announcement-bar" %}
{% endif %}
Hey, thank you for the quick reply. I did a search in the theme.liquid for {% section "announcement-bar" %} and it does not exist. There is, however, a separate announcement-bar.liquid. Would I need to modify something in here instead?
@made4Uo wrote:Hi @bbry,
If you found the section code. It should look like below
{% section "announcement-bar" %}
You need to enclose it in the "if statement", then your code should look like below
{% if template.name != "product" %}
{% section "announcement-bar" %}
{% endif %}
Add this code at the top
{% if template.name != 'product' %}
As shown
Then this Code at line 222
{% endif %}
As shown
This should work