How to add a custom announcement bar in shopify

Written by
Priyanka Singh
Front End Developer
Table of contents
Build with Radial Code
An announcement bar is a simple yet effective way to share important updates, promote discounts, and highlight special offers on your Shopify store. It usually appears at the top of your website, making it one of the first things visitors notice. Whether you want to announce free shipping, display a discount code, or promote a new product collection, a custom announcement bar helps you communicate with customers without changing your entire website design.
Shopify themes often include a built-in announcement bar, but its customization options may be limited. In this guide, you'll learn how to add an announcement bar using Shopify's Theme Editor and how to create a custom announcement bar using Liquid code. If you're exploring Shopify development and customization, you can also visit Radial Code to learn more about professional web development services.
What is an announcement bar in shopify?
An announcement bar is a promotional or informational banner displayed near the top of a Shopify store, usually above the main navigation menu.
Store owners use it to communicate important messages, such as:
- Discount announcements: Get 15% off your first order.
- Free shipping offers: Enjoy free shipping on orders over $50.
- New product launches: Discover our latest collection.
- Limited-time promotions: Shop our seasonal sale before it ends.
- Important updates: Orders placed today will be shipped within 2–3 business days.
A well-designed announcement bar helps customers find important information quickly without interrupting their shopping experience.
Why should you add an announcement bar to your shopify store?
Adding an announcement bar can make important store information more visible to visitors. Here are some practical benefits:
1. Highlight special offers
An announcement bar gives your promotional offers a visible position on your website. Customers can quickly notice discount codes, seasonal promotions, and limited-time deals.
2. Share important store updates
You can inform visitors about shipping delays, holiday schedules, updated policies, or other important information without creating a separate page.
3. Improve offer visibility
Instead of requiring customers to search for promotional information, you can display relevant offers near the top of your store.
4. Direct customers to important pages
You can add a clickable link to your announcement bar and direct visitors to a specific product, collection, or promotional landing page.
5. Maintain consistent branding
A custom announcement bar allows you to match its colors, typography, spacing, and overall appearance with your Shopify store's design.
Method 1: Add an announcement bar using shopify's theme editor
Before writing custom code, check whether your Shopify theme already includes an announcement bar.
Many Shopify themes provide built-in announcement settings, allowing you to add messages and customize their appearance without editing Liquid files.
Follow these steps:
Step 1: Open your shopify theme editor
- Log in to your Shopify admin.
- Navigate to Online Store → Themes.
- Find your active theme.
- Click Edit theme to open the Theme Editor.
Step 2: Find the announcement bar section
Look for the Announcement Bar section in the Header area or the list of available sections.
If your theme supports this feature, you can select it directly.
Step 3: Add your announcement message
Click Add Announcement and enter the message you want visitors to see.
For example:
"Free Shipping on All Orders Above $50!"
You can also add a link to direct customers to a relevant collection or promotional page.
Step 4: Customize its appearance
Depending on your theme, you may be able to customize:
- Background and text colors
- Announcement text
- Link destination
- Multiple announcement messages
- Automatic message rotation
- Country and language selectors
Step 5: Save your changes
Click Save and preview your storefront to check how the announcement bar looks on desktop and mobile devices.
Note: Not every Shopify theme offers the same announcement bar settings. If your theme doesn't provide the functionality you need, you can create a custom section or use an announcement bar app.
Method 2: Create a custom announcement bar using shopify liquid
If you want greater control over your announcement bar, you can create a custom Shopify section using Liquid, HTML, and CSS.
This approach allows you to create editable settings that store owners can manage directly from the Theme Editor.
Step 1: Open shopify code editor
- Go to shopify admin
- Navigate to Online Store → Themes.
- Click the three-dot menu next to your active theme.
- Select Edit code.
- Open the Sections folder.
Before editing your theme, consider duplicating it so you have a backup of the original version.
Step 2: Create a new liquid section
Inside the Sections folder:
- Click Add a new section.
- Name the file custom-announcement-bar.
- Open the newly created file.
This file will contain the announcement bar's HTML markup, CSS styling, and schema settings.
Step 3: Add the custom announcement bar code
Paste the following code into your custom-announcement-bar.liquid file:
{% if section.settings.show_announcement %}
{% if section.settings.homepage_only == false or request.page_type == 'index' %}
{% endif %}
{% endif %}
{% schema %}
{
"name": "Custom Announcement Bar",
"settings": [
{
"type": "checkbox",
"id": "show_announcement",
"label": "Show announcement bar",
"default": true
},
{
"type": "checkbox",
"id": "homepage_only",
"label": "Show only on homepage",
"default": false
},
{
"type": "text",
"id": "announcement_text",
"label": "Announcement message",
"default": "Free shipping on orders over $50!"
},
{
"type": "url",
"id": "announcement_link",
"label": "Announcement link"
},
{
"type": "color",
"id": "background_color",
"label": "Background color",
"default": "#1E4D40"
},
{
"type": "color",
"id": "text_color",
"label": "Text color",
"default": "#FFFFFF"
},
{
"type": "select",
"id": "text_alignment",
"label": "Text alignment",
"options": [
{
"value": "left",
"label": "Left"
},
{
"value": "center",
"label": "Center"
},
{
"value": "right",
"label": "Right"
}
],
"default": "center"
},
{
"type": "range",
"id": "font_size",
"label": "Font size",
"min": 10,
"max": 24,
"step": 1,
"default": 14,
"unit": "px"
}
],
"presets": [
{
"name": "Custom Announcement Bar"
}
]
}
{% endschema %}Step 4: Add the section to your store
After saving the Liquid file:
- Return to Online Store → Themes → Edit theme.
- Open the Header section group in the Theme Editor.
- Click Add section.
- Search for Custom Announcement Bar.
- Add it and position it above your main header.
- Click Save.
If your theme does not allow custom sections in its header group, check its section-group configuration and theme architecture before choosing another placement method.
Step 5: Customize the announcement bar
Once the section is added, you can manage its settings directly through the Theme Editor.
The custom section provides the following options:
|
Setting |
Function |
|---|---|
|
Show announcement bar |
Enable or disable the bar |
|
Homepage only |
Display it only on the homepage |
|
Announcement message |
Change the displayed text |
|
Announcement link |
Add a clickable destination |
|
Background color |
Change the background |
|
Text color |
Customize text color |
|
Text alignment |
Set left, center, or right alignment |
|
Font size |
Adjust the text size |
You can update these settings without editing the Liquid code again.
Common shopify announcement bar problems and their solutions
Sometimes an announcement bar may not display as expected. Here are a few common problems and ways to troubleshoot them.
|
Problem |
Possible solution |
|---|---|
|
Announcement bar is not visible |
Check whether the section is enabled and added to the correct section group |
|
Text is difficult to read |
Adjust text and background colors |
|
Announcement link is not working |
Verify the destination URL |
|
Mobile layout looks incorrect |
Review responsive CSS and text wrapping |
|
Announcement bar appears twice |
Check for duplicate theme sections or app-generated announcement bars |
|
Changes are not appearing |
Save the theme and check the correct theme preview |
If you're using a third-party announcement bar app, also check its app embed settings and placement instructions.
Conclusion
Adding a custom announcement bar in Shopify is a simple way to highlight offers, share updates, and guide customers to important store pages. You can use your theme's built-in settings or create a custom Liquid section for more design flexibility.
Need help with Shopify customization ? Contact Radial Code to discuss your Shopify development requirements.