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
3817 715 1132

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

 

Volunteering to assist you!  Likes and Accept as Solution  is highly appreciated.✌
Coffee fuels my dedication. If helpful, a small Coffee Tip would be greatly appreciated.
Need EXPERIENCED Shopify developer without breaking the bank?
Hire us at Made4Uo.com for quick replies.
Stay in control and maintain your security by avoiding unnecessary store access!

View solution in original post

Replies 7 (7)

PaulNewton
Shopify Partner
6275 574 1326

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.

Save time & money ,Ask Questions The Smart Way


Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org


made4Uo
Shopify Partner
3817 715 1132

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

 

Volunteering to assist you!  Likes and Accept as Solution  is highly appreciated.✌
Coffee fuels my dedication. If helpful, a small Coffee Tip would be greatly appreciated.
Need EXPERIENCED Shopify developer without breaking the bank?
Hire us at Made4Uo.com for quick replies.
Stay in control and maintain your security by avoiding unnecessary store access!
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
3817 715 1132

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 %}
Volunteering to assist you!  Likes and Accept as Solution  is highly appreciated.✌
Coffee fuels my dedication. If helpful, a small Coffee Tip would be greatly appreciated.
Need EXPERIENCED Shopify developer without breaking the bank?
Hire us at Made4Uo.com for quick replies.
Stay in control and maintain your security by avoiding unnecessary store access!
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