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

Remove announcement bar from product page only

Solved

Remove announcement bar from product page only

saucyware
Tourist
9 0 5

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!

Accepted Solution (1)

made4Uo
Shopify Partner
3877 719 1237

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 %}

 

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free

View solution in original post

Replies 7 (7)

PaulNewton
Shopify Partner
8031 688 1649

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


made4Uo
Shopify Partner
3877 719 1237

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 %}

 

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free
saucyware
Tourist
9 0 5

Thank you, this worked 🙂

bbry
New Member
5 0 0

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

 

made4Uo
Shopify Partner
3877 719 1237

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 %}
If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free
bbry
New Member
5 0 0

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 %}

 




JacobGriswold
Tourist
3 0 0

Add this code at the top 

 

{% if template.name != 'product' %}

 

 

As shown

Screenshot 2024-02-18 063315.png

 

Then this Code at line 222

 

 

{% endif %}

 

As shown

Screenshot 2024-02-18 063333.png

 

 This should work