Marketing · Gutenberg

Announcement Strip block for WordPress

A thin dismissible announcement bar — ideal above the site header for promotions, launches, or alerts.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

A thin dismissible announcement bar — ideal above the site header for promotions, launches, or alerts.

Inspector panels on this block: Content, Countdown. Those titles come from index.js, not from a shared template.

Behavior controls: “Link target” options: Same tab, New tab; “End date (YYYY-MM-DD HH:MM)” (e.g. 2026-12-31 23:59); “Preset style” options: Gradient (purple→blue), Purple, Dark, Info (blue), Warning (amber); “Text align” options: Center, Left.

Where to find it

Gutenberg inserter → Marketing → search “Announcement Strip” (block name `blockenberg/announcement-strip` in block.json). Style it in the sidebar after insert.

How to use Announcement Strip block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Announcement Strip”, insert it. Category: Marketing.
  3. Configure inspector controls that exist on this block. Open Content. Set “Show badge”, “Badge text”, “Show link”, “Link label”.
  4. Check the published page. The view script reads HTML data attributes: data-close-days, data-close-id, data-countdown. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
Show badgeOn/off toggle in the inspector. On by default. Saved as `showBadge`.
Badge textText field in the inspector. block.json default: New. Saved as `badgeText`.
Show linkOn/off toggle in the inspector. On by default. Saved as `showLink`.
Link labelText field in the inspector. block.json default: Learn more →. Saved as `linkLabel`.
Link URLText field in the inspector. block.json default: #. Saved as `linkUrl`.
Link targetSelect control; the chosen value is saved on the block. Options: Same tab; New tab. block.json default: _self. Saved as `linkTarget`.
Show close buttonOn/off toggle in the inspector. On by default. Saved as `showClose`.
Close ID (unique per bar)Text field in the inspector. block.json default: anst-1. Saved as `closeId`.
Remember close (days)Numeric range control in the inspector. Range 0–365. block.json default: 7. Saved as `closeDays`.
Show countdownOn/off toggle in the inspector. Off by default. Saved as `showCountdown`.
End date (YYYY-MM-DD HH:MM)Text field in the inspector. e.g. 2026-12-31 23:59. Saved as `countdownDate`.
Preset styleSelect control; the chosen value is saved on the block. Options: Gradient (purple→blue); Purple; Dark; Info (blue); Warning (amber); Success (green); Custom color. block.json default: gradient. Saved as `style`.
Text alignSelect control; the chosen value is saved on the block. Options: Center; Left. block.json default: center. Saved as `textAlign`.
Vertical padding (px)Numeric range control in the inspector. Range 4–32. block.json default: 11. Saved as `paddingY`.
Text colorColor control in the inspector. block.json default: #ffffff. Saved as `textColor`.
Link colorColor control in the inspector. block.json default: #fde68a. Saved as `linkColor`.
Badge bgColor control in the inspector. block.json default: rgba(255,255,255,0.22). Saved as `badgeBg`.
Badge textColor control in the inspector. block.json default: #ffffff. Saved as `badgeColor`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the Announcement Strip block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Announcement Strip”. It sits under Marketing. After insert, open Content and set “Show badge”, “Badge text”, “Show link”, “Link label”.

Where does Announcement Strip store visitor state?

In localStorage on that browser. Clearing site data resets it. It is not a WordPress user meta field unless render.php says so.

Is the Announcement Strip Gutenberg block free?

Yes. Announcement Strip ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Announcement Strip to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Content, Countdown).

Related marketing blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Announcement Strip from the Gutenberg inserter.

Get Blockenberg