Remove announcement bar from product page only

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!

CSS based customization.

In the theme designer on the product template page create a custom-liquid section and add the following style:


You will want to make note in your documentation you’ve done this so it’s not forgotten about down the road.

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

Thank you, this worked :slightly_smiling_face:

1 Like

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?

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