i have 2 announcements bars i made that i only want on 1 specific page but it is showing on all my pages. can anyone help with this?
Hi @ScentedCozy
Could you drop your store URL and the page URL that you want announcement bar appear?
store: https://scentedcozyco.com/
page i want it on : https://scentedcozyco.com/collections/deodorizing-powder
the 2 pink ones are what i want only on the attached page. all other announcement bars are fine as is.
Go to Online store > Themes > Edit code, open theme.liquid file, add this code after tag
{% if collection.handle != 'deodorizing-powder' %}
#shopify-section-sections--21674540335406__cfbc8c96-fb81-492e-b46c-18a8d8c0c42f,
#shopify-section-sections--21674540335406__8241898b-16d2-4d5b-8944-176a207060a9 {
display: none !important;
}
{% endif %}
Yes, it correct
My mistake, please update code to this
{% if collection.handle != 'deodorizing-powder' %}
{% endif %}
just to be clear, do i hit enter to start a new line or add it directly after
Both will work
thank you! worked great!
You are most welcome.
Hi @Dan-From-Ryviu ,
I’ve been playing around with this. But I wonder if it’s possible to use this type of coding to restrict one announcement to one collection while also not allowing the general announcements to show on that one collection?
For example, I have a retail shop with one wholesale collection. I want only the wholesale announcement to show on that collection, but not anywhere else.
Thanks in advance for any help:)
Leila
{% if collection.handle != ‘wholesale-items’ %}
{% endif %}

