Linux 软件免费装
Banner图

Definitive Announcement Bar – Simple, Lightweight Top Bar for Bricks and Online Stores

开发者 studioleokawa
更新时间 2026年9月30日 21:41
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

woocommerce notification bar announcement bar top bar bricks

下载

1.0.0

详情介绍:

Definitive Announcement Bar adds a clean bar to the top of your site for shipping notices, sales, opening hours or any other short message. Add several messages and they cross-fade automatically. It is built to stay out of your way: one small stylesheet, one small script without jQuery, and nothing is loaded on pages where the bar is hidden. Works with your setup Features

安装:

  1. In your WordPress admin, go to Plugins → Add New and search for "Definitive Announcement Bar".
  2. Install and activate the plugin.
  3. Go to Settings → Announcement Bar, add your messages and save.

屏幕截图:

  • Content and placement settings.
  • Appearance, close button and display rules.

常见问题:

Does it work with Bricks Builder?

Yes. When Bricks is your active theme, the bar is printed right before the Bricks header template. If you would rather place it inside your header, choose "Manual" placement and add the [definitive_announcement_bar] shortcode with a Bricks Shortcode element.

Does it work with WooCommerce?

Yes. WooCommerce pages get their own display rules, so you can, for example, hide the bar on the checkout. You can also hide it on individual products.

My sticky header covers the bar. What can I do?

When the bar is visible, its height is available as the CSS variable --dabar-height on the html element. Add top: var(--dabar-height, 0px); to your sticky header. The variable is set to 0px once a visitor closes the bar.

The sticky option does not work.

Sticky positioning is blocked when a parent element uses overflow: hidden. Check your theme or custom CSS for overflow on html, body or wrapper elements.

When does a closed bar show again?

With "Keep closed for" set to 0, the bar comes back in the next browser session. Otherwise it stays closed for the number of days you choose. Changing the messages always shows the bar again to everyone.

Can I control where the bar appears with code?

Use the dabar_should_display filter: add_filter( 'dabar_should_display', function ( $display ) { return is_page( 'contact' ) ? false : $display; } );

Can I style the bar with my own CSS?

Yes. The bar uses the ID #dabar and the classes .dabar__inner, .dabar__content, .dabar__message, .dabar__button and .dabar__close. The colors and sizes are CSS custom properties (--dabar-bg, --dabar-color, --dabar-close-color, --dabar-link-color, --dabar-button-bg, --dabar-button-color, --dabar-font-family, --dabar-font-size, --dabar-min-height, --dabar-padding), so you can override them in your stylesheet.

更新日志:

1.0.0