Shopify Announcement Bar on Homepage Only: A Community-Approved Guide for the Savor Theme

Hey there, fellow store owners! As a Shopify expert who spends a lot of time sifting through community discussions, I often come across common pain points that many of you face. One topic that popped up recently, and generated some really helpful insights, was about managing that ever-present announcement bar. Specifically, a store owner named zaraap, using the Savor theme, wanted to know: "How can I set my announcement bar to appear only on the homepage?"

It’s a great question, right? Sometimes you want a special welcome message or a homepage-specific promotion without cluttering every single product page or collection. Zaraap mentioned not being super familiar with editing theme code, which is totally understandable and a common scenario for many of you. The good news? The community rallied with some fantastic solutions, offering both beginner-friendly and slightly more advanced options.

Why Homepage-Only Announcements Make Sense

Before we dive into the "how," let's quickly touch on the "why." Limiting your announcement bar to the homepage can:

  • Reduce Clutter: Keep your product and collection pages clean, focusing shoppers on their buying decision.
  • Target Messaging: Deliver specific welcome messages, first-time buyer discounts, or general store news that's most relevant when a customer first lands on your site.
  • Improve UX: Some customers find persistent announcement bars distracting, especially if the message isn't relevant to every page they visit.

The Community's Top Picks: Two Main Approaches

The discussion in the Shopify forums brought forward a couple of excellent strategies. One involves using a bit of CSS to hide the bar on other pages, and the other uses Liquid code to prevent it from rendering entirely. Let's break them down.

Method 1: The "Magic" No-Code-File-Editing Solution (Recommended for Beginners)

This was the solution that zaraap ultimately found worked "like a magic!" and it's fantastic because it largely avoids direct file editing in your theme code, which can be a relief for many. Tim_1, a helpful community member, shared this gem.

Step-by-Step Instructions:

  1. Go to your Shopify Admin: Navigate to Online Store > Themes.
  2. Customize Your Theme: Click on the Customize button for your Savor theme.
  3. Add a Custom Liquid Section: In the theme editor, look for your Header Group (it's usually near the top). You'll want to add a new section here. Click Add section and choose Custom liquid. Make sure to drag this new section to the very top of your Header Group, above your Announcement bar section. This is crucial for the CSS to apply correctly!
  4. Paste the Code: In the Custom Liquid section, paste the following code into the provided text area:
    {% unless template.name == "index" %}
      
    {% endunless %}
    
  5. Save Your Changes: Don't forget to hit Save in the top right corner!

Here's a visual from Tim_1 to help you find where to add the Custom Liquid section:

Why this works so well: The {% unless template.name == "index" %} part tells Shopify, "Unless this is the homepage, apply the following styles." The CSS then simply sets display: none; for any element with an ID containing "header_announcements" (a common identifier for announcement bars in Shopify themes). Because you're using the Custom Liquid section, you're not directly touching core theme files, which helps with future theme updates!

Method 2: The "Cleaner Render" Code-Editing Approach (For the More Adventurous)

For those of you a bit more comfortable diving into your theme's code, there's another approach suggested by community members Wsp and devcoders. This method prevents the announcement bar from even being rendered on non-homepage pages, which is arguably a cleaner solution from a code perspective.

Step-by-Step Instructions:

  1. Backup Your Theme! Seriously, always duplicate your theme before making any code edits. Go to Online Store > Themes > Actions > Duplicate.
  2. Edit Code: In your Shopify Admin, go to Online Store > Themes, then click Actions > Edit Code for your *duplicated* theme.
  3. Find theme.liquid: Under the Layout folder, open theme.liquid.
  4. Locate the Announcement Bar Section: Search for "announcement" (Ctrl + F or Cmd + F). You're looking for a line that likely looks like {% section ‘announcement-bar’ %} or {% render ‘announcement-bar’ %}.
  5. Wrap with a Conditional Statement: Replace that line with this code:
    {% if request.page_type == ‘index’ %}
      {% section ‘announcement-bar’ %}
    {% endif %}
    

    Alternatively, some themes might have the announcement bar code within its own section file (e.g., sections/announcement-bar.liquid). If you find that, you could wrap the *entire content* of that file with {% if template == ‘index’ %} ... {% endif %}.

  6. Save Your Changes: Click Save.

This method uses Liquid's request.page_type == 'index' or template == 'index' to check if the current page is the homepage. If it is, the announcement bar section is included; otherwise, it's skipped entirely. It's a very efficient way to control rendering.

A Quick Note on CSS Selectors

You might have noticed that Dan-From-Ryviu also suggested a CSS-based approach, similar to Tim_1's, but using .announcement-bar { display: none !important; }. While this also works, Tim_1's selector [id*=header_announcements] is often more robust as it targets elements containing "header_announcements" in their ID, which can be more consistent across different Savor theme versions or customizations than a generic class name.

The Community Spirit

It was great to see other community members like Bahbbao, Moeed, and Mustafa_Ali offering to directly check zaraap's store URL. This really highlights the supportive nature of the Shopify community – when in doubt, sometimes a fresh pair of eyes can make all the difference!

So, whether you're a seasoned Shopify veteran or just starting out like zaraap, remember there are always creative solutions to common customization challenges. For most Savor theme users who want a simple, update-friendly way to get their announcement bar homepage-only, Tim_1's Custom Liquid method is definitely the way to go. But if you're comfortable with a bit of code and prefer a "no-render" approach, the theme.liquid edit is a solid alternative. Happy customizing!

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases