Products / Announcement Bar / Docs

Evergreen Announcement Bar

A bar across the top (or bottom) of every page for sales, events, closures and news, with a live countdown, start and end dates, rotating messages and a close button. One small script, no dependencies.

What's in the download

File or folderWhat it's for
INSTALL.mdStep-by-step setup for Squarespace (every plan), WordPress, Wix, Webflow, Shopify, Ghost, Carrd and plain HTML
embed/Ready-to-paste snippets. Start here.
templates/announcements-template.csvSpreadsheet template for scheduling several messages
evergreen-announcement-bar.zipThe WordPress plugin. Upload it under Plugins → Add New → Upload Plugin.
dist/announcement-bar.min.jsThe compact script. Use it if you upload the file to your site.
dist/announcement-bar.jsThe readable script, for anyone who wants to look inside
demo/index.htmlDouble-click to try it offline
LICENSE.txtWhat your license allows

The whole idea in one line

<div data-announcement-bar data-message="Black Friday: **30% off** ends in {countdown}" data-countdown="2026-11-30 23:59" data-link="/shop" data-button="Shop the sale"></div>

Put that, plus the script, in your site-wide footer code. Every option is another data- attribute. See Options in INSTALL.md.

For developers

EvergreenAnnouncementBar.get().refresh();   // re-check dates and page rules (e.g. after client-side navigation)

Questions or installation help: use the contact page at evergreencode.store.

Installation

The bar is added once for your whole site, usually in a site-wide footer code area. It then moves itself to the top (or bottom) of every page.

You choose how to write your announcements:

  • One message: type it straight into the snippet (embed/1-single-message-embed.html). Easiest.
  • Several messages, or a schedule: list them in a Google Sheet (embed/2-google-sheet-embed.html). Messages turn on and off by date, rotate, and your team can edit them without touching the website.

Your message

Prefer clicking to typing? The free Announcement Bar Builder lets you write the message, set the countdown and pick colors with a live preview, then copies the finished code for Squarespace, WordPress or any site.

In the snippet, change the text between the quotes:

<div data-announcement-bar
     data-message="Black Friday: **30% off** everything. Ends in {countdown}"
     data-countdown="2026-11-30 23:59"
     data-link="/shop"
     data-button="Shop the sale"></div>
  • **double asterisks** make text bold.
  • {countdown} is where the live timer goes. Leave it out and the timer is added at the end.
  • With data-link but no data-button, the whole message becomes the link. Remove both for a bar with no link.

Dates can be written as 2026-11-30, 2026-11-30 18:00, 11/30/2026 or 11/30/2026 6:00 PM. They use each visitor's own time zone. To pin a time zone, add it: 2026-11-30T23:59-06:00 is 11:59 PM Central.

Several messages: Google Sheet

  1. Go to sheets.google.com, then File → Import → Upload and choose templates/announcements-template.csv.
  2. One row per announcement:
ColumnWhat goes in it
Message (required)The text. **bold** and {countdown} work here too.
LinkOptional page the message or button opens
ButtonOptional button text. Empty = the message itself is the link.
StartOptional. The message appears from this date.
EndOptional. The message disappears after this date (a date without a time means the end of that day).
CountdownOptional. Shows a live timer to this date and time.
EndedOptional. Shown instead once the countdown reaches zero. Empty = the message disappears.
PagesOptional. Only show on these pages (see Pages below).

When several messages are active at once, the bar rotates through them every 6 seconds, with arrows for visitors. Rotation pauses while someone points at or tabs into the bar.

  1. Click File → Share → Publish to web, choose your sheet tab, change "Web page" to Comma-separated values (.csv), and click Publish.
  2. Copy the link (it contains /pub? and ends in output=csv) into data-src in embed/2-google-sheet-embed.html.

Changes in the sheet appear on your site within about 5 minutes.

Squarespace

Works on Squarespace 7.1 and 7.0, in any template, on every plan. The bar moves your site's fixed header down so it never covers your menu.

Core, Plus or Advanced plans (legacy Business and Commerce)

  1. Go to Settings → Advanced → Code Injection (or Website → Pages → Custom Code → Code Injection).
  2. Paste embed/1-single-message-embed.html (or the Google Sheet version) into Footer and save.

That's it: the bar is on every page.

Basic plan (legacy Personal): no upgrade needed

Basic and Personal plans don't have Code Injection, but Markdown Blocks accept HTML on every plan, and your site footer appears on every page.

This is a widely used workaround, but Squarespace doesn't officially support it and could change how Markdown Blocks behave in the future.

  1. Upload the script file. Edit any text block, highlight a word, click the link icon, then File → Upload file, and upload dist/announcement-bar.min.js. Remove the temporary link afterward. The file is now at /s/announcement-bar.min.js.
  2. Add it to your footer. Click Edit, hover over the footer, click Edit Footer, add a Markdown block, and paste the two lines from embed/3-markdown-block.html. Change the message. Keep each tag on one line.

The Markdown block looks empty in your footer. That's normal: the bar appears at the top of the page. If your site has no footer, put the block on each page that should show the bar.

WordPress

  1. Go to Plugins → Add New → Upload Plugin, choose evergreen-announcement-bar.zip, click Install Now, then Activate.
  2. Go to Settings → Announcement Bar, tick Show the bar, type your message, and save.

Everything below has a field on that screen: link, button, countdown, start and end dates, pages, colors, position, and a Google Sheet link for several messages. Works with any theme and page builder.

If a caching or speed plugin breaks the bar, exclude announcement-bar.min.js from its "delay JavaScript" or "combine JS" settings, and clear the cache after changing the message.

Wix

Go to Settings → Custom Code → + Add Custom Code, paste embed/1-single-message-embed.html, choose All pages, place it in Body - end, and apply. Custom code needs a Wix premium plan with a connected domain.

Webflow

Paste embed/1-single-message-embed.html into Site settings → Custom code → Footer code and publish. Custom code needs a paid site plan.

Shopify

Go to Online Store → Themes → … → Edit code, open theme.liquid, and paste embed/1-single-message-embed.html just before </body>. Save.

Ghost

Paste embed/1-single-message-embed.html into Settings → Code injection → Site Footer.

Carrd

Add an Embed element, set its type to Code, and paste embed/1-single-message-embed.html. Embeds need a Carrd Pro plan.

Any website (HTML)

Upload dist/announcement-bar.min.js and use embed/4-hosted-file-embed.html on each page (or in a shared footer).

Options

Add any of these to the <div data-announcement-bar …> tag:

AttributeWhat it doesExample
data-messageThe message (for one message)data-message="Free shipping over $50"
data-link / data-buttonLink, and optional button textdata-link="/shop" data-button="Shop now"
data-countdownLive timer to this date and timedata-countdown="2026-11-30 23:59"
data-endedMessage after the countdown ends (empty = hide the bar)data-ended="The sale has ended. Thank you!"
data-start / data-endShow only between these datesdata-start="2026-11-27" data-end="2026-11-30"
data-pagesOnly on these pagesdata-pages="/shop, /shop/*"
data-srcGoogle Sheet (CSV) or CSV file link for several messagesdata-src="https://docs.google.com/…output=csv"
data-positiontop (stays visible, default), bottom, or scroll (top, scrolls away)data-position="bottom"
data-background / data-colorBar colorsdata-background="#b3261e" data-color="#fff"
data-button-background / data-button-colorButton colorsdata-button-background="#ffd54f"
data-sizeText size in pixels (default 15)data-size="14"
data-dismissfalse to remove the close buttondata-dismiss="false"
data-dismiss-daysHow long a closed bar stays closed (default 7). A changed message shows again right away.data-dismiss-days="1"
data-rotateSeconds between rotating messages (default 6; 0 = no auto-rotate)data-rotate="8"
data-push-headerfalse to stop the bar moving your site's fixed header downdata-push-header="false"
data-text-closeScreen-reader label for the close button, e.g. in another languagedata-text-close="Cerrar"

Pages

data-pages (or the Pages column) takes page addresses separated by commas:

  • /shop shows only on that page.
  • /shop/* shows on /shop and every page under it.
  • !/checkout hides it on that page. Combine: /blog/*, !/blog/private.
  • / is the home page only. Leave it empty for every page.

Troubleshooting

The bar doesn't appear. Check the published site, not the editor. Check the dates (a message that hasn't started, or has ended, stays hidden). If you clicked the close button while testing, the bar stays closed on your computer for 7 days: open the site in a private window, or change the message. Open your browser's console for messages starting with [Announcement Bar].

The bar covers my menu. Tell us your theme and we'll help. As a quick fix, try data-position="scroll" or data-position="bottom".

Times are off by a few hours. Dates use each visitor's time zone. Add your zone to pin it: 2026-11-30T23:59-06:00.

Still stuck? Use the contact page at evergreencode.store. Installation help is included for 6 months.

Changelog

1.0.0 (2026-10-30)

First release.

  • Announcement bar at the top (stays visible or scrolls away) or bottom of every page.
  • One message from the snippet, or several from a Google Sheet, CSV file or pasted rows, rotating with previous/next arrows.
  • Live countdown timer, with an optional message for when it ends.
  • Start and end dates for each message, in the visitor's own time zone.
  • Show or hide on chosen pages (/shop, /blog/*, !/checkout).
  • Dismiss button remembered for a number of days; a changed message shows again.
  • Moves fixed and sticky site headers down so the bar never covers your menu.
  • Colors, text size, bold text, a link or button per message.
  • WordPress plugin with a Settings → Announcement Bar screen.
  • Install guides for Squarespace (every plan, including Basic/Personal via Markdown Blocks), WordPress, Wix, Webflow, Shopify, Ghost, Carrd and plain HTML.
  • Keyboard and screen-reader friendly; respects reduced motion; shielded from site-wide styles.