Skip to content

Announcement Bar

The announcement bar is a strip at the very top of every page, above the top bar and the header, with one message and an optional button. The theme draws it and owns its settings; Promptless WP’s connector can change them for you.

This page covers how the theme behaves. For writing the message, choosing options and using the connector, see Announcement Bar in the Promptless WP documentation.

  1. Go to Appearance → Customize → Announcement Bar → Announcement Bar Settings.
  2. Tick Enable Announcement Bar and write the Message.
  3. Optionally fill in CTA Button Text and CTA Button URL, choose Theme, and set Allow Visitors to Dismiss, Start Date / Time and End Date / Time.
  4. Select Publish.
OptionDefault
Enable Announcement BarOff
MessageEmpty
CTA Button Text, CTA Button URLEmpty
Theme (Light or Dark)Dark
Allow Visitors to DismissOn
Start Date / Time, End Date / TimeEmpty

The bar appears on every page that uses the theme’s header, including Promptless WP Full Width pages. It does not appear on Canvas pages, which have no header.

On each page load the server checks four things, and shows the bar only when all four pass:

  1. Enable Announcement Bar is ticked.
  2. The Message has some text. A message of only spaces or empty tags counts as empty.
  3. The current time is inside the schedule. An empty start means from now; an empty end means no end. Times are in the site’s timezone from Settings → General.
  4. This visitor has not closed this message.

Because the server decides, the bar never flashes up and then disappears.

With Allow Visitors to Dismiss on, the bar has a close button. Closing it stores a cookie in that visitor’s browser for 365 days, and the bar stays hidden for them on every page.

The cookie is tied to the message text. Change the Message and everyone sees the bar again, including people who closed the old one. Changing only the button, theme or dates, or only spacing in the message, does not bring it back.

With Allow Visitors to Dismiss off there is no close button and the bar always shows while it is enabled and scheduled. Use this for notices everyone must see.

The button appears only when both CTA Button Text and CTA Button URL are filled in. It uses Promptless WP’s primary button style in its compact size. Screen readers and search engines read the button label followed by the message, so a label such as Learn more still describes where it goes.

The Message can include Promptless WP reusable element shortcodes such as [re:phone_number], and the theme replaces them with their current value when the page is shown. This needs Promptless WP to be active.

  • One bar for the whole site. It cannot be limited to some pages.
  • The bar does not appear. Go through the four checks above in order. If you closed it yourself, clear this site’s cookies or use a private window.
  • A page cache keeps showing an old bar, or shows it after the end date. The theme decides on the server, so a full-page cache serves whatever it stored, and can keep showing the bar to visitors who closed it. Clear the cache after changing the bar.

Available since Promptless Theme 1.1.7.