Share big stories, special offers, or breaking news at the top of your site with the new announcement bar feature.
To add an announcement to every page of your site, go to Settings → Announcement bar and add your announcement copy, pick a background color, and select the visibility of your announcement:
The visibility options allow you to share different types of announcements based on what makes sense for your audience. For example:
Highlight breaking news for everyone on your site
Share a special offer for your paid tiers just with new visitors and free members
Exclusively invite your paid members to join your community
Announcements can be removed at any time by either removing the message or toggling off visibility for everyone in your settings and hitting Save.
Ghost(Pro) users can log in and start enjoying all of this right away! If you're a developer, self-hosting Ghost, you'll need to update to the latest version to get access to everything that's new.
Its usability would grow multiple fold if we are allowed to show different announcements for different membership levels. One for free member, another for paid members etc.
Is it possible to disable the injection of the announcement bar CSS into the <head> element? I’m looking to replace his CSS from theme to theme, but even if I remove that import, the CSS is still injected…
The settings endpoint accepts an array of key-value-pairs and, according to the current source code (5.49.0 as of writing this post) there are three keys that are relevant for the announcement bar:
As mentioned, this is not documented here and therefore not an official API endpoint. It can change at any point and I rather see this as an experiment of what’s possible
There are (at least) two ways to style the announcement bar at the moment:
Use Code Injection or CSS and append your properties with !important. This will override the default values.
Add your styles after ghost_head in a theme. As long as the selector specificity is the same, they will take precedence because they’re further down the cascade.
I have a sticky nav bar on my theme so that it is always displayed at the top of the page.The announcement bar is causing an issue where when you scroll down the announcement bar disappears, but the head still keeps the space above it.