Hi,
I’m new to Shopify and trying to figure how can I enable announcement bar only on the homepage with Savor theme.
Thank you!
Hi,
I’m new to Shopify and trying to figure how can I enable announcement bar only on the homepage with Savor theme.
Thank you!
Hey @zaraap Welcome to Shopify Community can you please share the Website URL
Hey @zaraap
Welcome to Shopify Community! Can you share your Store URL so I can have a look on it? Also, if you have password enabled then please share the password as well. Your cooperation would be greatly appreciated.
Best Regards,
Moeed
Add a “Custom liquid” section to the top of the Header Group:
Paste this code:
{% unless template.name == "index" %}
<style>
[id*=header_announcements] {
display: none;
}
</style>
{% endunless %}
if my post is helpful, please like it via ♡ button and mark as a solution -- this will help others find it
You can do that by adding this code to theme.liquid file after
{% unless template == 'index' %}
<style>
.announcement-bar { display: none !important; }
</style>
{% endunless %}
Dan from Ryviu: Product Reviews App
Hi @zaraap
You can enable the announcement bar only on the homepage by adding a simple condition in the announcement bar section/snippet.
In the Savor theme, open the announcement bar file and wrap the code with:
{% if template == ‘index’ %}
{% endif %}
This condition ensures the announcement bar appears only on the homepage.
Hey @zaraap
Step 1 . Go to theme code
Online Store → Themes → Edit Code
Step 2 . Open file
Layout → theme.liquid
Step 3 . Find announcement bar line
Search: announcement
You will find something like:
{% section ‘announcement-bar’ %} or {% render ‘announcement-bar’ %}
Step 4 . Replace with this FINAL SAFE CODE
Use this:
{% if request.page_type == ‘index’ %}
{% section ‘announcement-bar’ %}
{% endif %}
I hope this help Otherwise you kindly provide your store URL please and if it is password protected, please share the password as well.
Thank You !
@zaraap kindly drop here the URL of your store for a quick check.
Works like a magic! Thank you!
Other suggestions would likely work too, but this one does not require editing theme code – this will help with further updates.
Yes, easier for me since I’m not familiar with editing the theme code.