Title: WP Alert Bar
Author: Ryan Bracey
Published: <strong>2020 年 6 月 4 日</strong>
Last modified: 2025 年 1 月 14 日

---

搜索插件

![](https://ps.w.org/wp-alert-bar/assets/banner-772x250.png?rev=3221900)

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/wp-alert-bar/assets/icon-256x256.png?rev=2317695)

# WP Alert Bar

 作者：[Ryan Bracey](https://profiles.wordpress.org/braceomatic88/)

[下载](https://downloads.wordpress.org/plugin/wp-alert-bar.zip)

 * [详情](https://cn.wordpress.org/plugins/wp-alert-bar/#description)
 * [评价](https://cn.wordpress.org/plugins/wp-alert-bar/#reviews)
 * [开发进展](https://cn.wordpress.org/plugins/wp-alert-bar/#developers)

 [支持](https://wordpress.org/support/plugin/wp-alert-bar/)

## 描述

WP Alert Bar allows you to quickly and easily add an alert bar to your WordPress
website.

All content and styles are fully customizable through the WordPress Customizer, 
allowing you to easily match the alert bar to your sites branding with no coding
necessary, and with real time preview you can see what you’re doing before publishing.
WP Alert Bar also gives you the ability modify the way the alert bar displays with
options to have the alert bar appear across your entire site or just the homepage,
or include a close button. This gives you the power to use WP Alert Bar in a way
that best fits your message.

WP Alert Bar also applies unique classes to the body tag and all elements of the
alert bar making it easy for developers to further modify the styles to fit the 
needs of your WordPress website.

### Features

 * Custom Colors to match your site branding
 * Custom title, message and call to action ( all items are optional and fully conditional)
 * Ability to display banner across your entire site or just the homepage
 * Body class added to pages where WP Alert Bar is visible

## 屏幕截图

[⌊WP Alert Bar section in customizer⌉⌊WP Alert Bar section in customizer⌉[

WP Alert Bar section in customizer

[⌊Sub sections in customizer for Styles, Content, and Display⌉⌊Sub sections in customizer
for Styles, Content, and Display⌉[

Sub sections in customizer for Styles, Content, and Display

[⌊Styles section to customize colors and font size. Options are editable from the
customizer with real time preview⌉⌊Styles section to customize colors and font size.
Options are editable from the customizer with real time preview⌉[

Styles section to customize colors and font size. Options are editable from the 
customizer with real time preview

[⌊Content section to add custom messaging and call to action. Options are editable
from the customizer with real time preview⌉⌊Content section to add custom messaging
and call to action. Options are editable from the customizer with real time preview⌉[

Content section to add custom messaging and call to action. Options are editable
from the customizer with real time preview

[⌊Display section to customize where the alert displays on your site. Options are
editable from the customizer with real time preview⌉⌊Display section to customize
where the alert displays on your site. Options are editable from the customizer 
with real time preview⌉[

Display section to customize where the alert displays on your site. Options are 
editable from the customizer with real time preview

## 常见问题

### My WordPress site has a sticky header that uses position fixed causing it to cover the WP Alert Bar, how can I fix this?

**WP Alert Bar** comes with a filter that allows you to define your sites fixed 
header so that it can account for the alert bar. Simply navigate to the functions.
php file in your child theme and paste in the following code snippet, making sure
to replace .site-header with the class or ID of your sites fixed position header.

    ```
    // Define fixed header for WP Alert Bar
    add_filter( 'mbwpab_fixed_header_selector', 'mbwpab_define_fixed_header' );
    function mbwpab_define_fixed_header( $header ) {
        $header     =   '.site-header';
        return $header;
    }
    ```

## 评价

此插件暂无评价。

## 贡献者及开发者

「WP Alert Bar」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Ryan Bracey ](https://profiles.wordpress.org/braceomatic88/)

「WP Alert Bar」插件已被翻译至 2 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/wp-alert-bar/contributors)
为本插件所做的贡献。

[帮助将「WP Alert Bar」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/wp-alert-bar)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/wp-alert-bar/)，查看
[SVN仓库](https://plugins.svn.wordpress.org/wp-alert-bar/)，或通过[RSS](https://plugins.trac.wordpress.org/log/wp-alert-bar/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/wp-alert-bar/)。

## 更新日志

#### 1.0.4

_Release Date – Jan 13 2025_

 * Fix – Tested plugin against the most recent version of WordPress.

#### 1.0.3

_Release Date – April 4 2023_

 * Fix – Tested plugin against the most recent version of WordPress.

#### 1.0.2

_Release Date – May 10 2021_

 * Fix – Adjusted hook priority for WordPress Alert Bar to prevent conflict with
   favicons set through the WordPress Customizer.

#### 1.0.1

_Release Date – Jun 12 2020_

 * New – Added class to WordPress Alert Bar when close button is active.
 * Fix – Gave unique class selector to WordPress Alert Bar call to action.
 * Fix – Removed extra right padding on mobile when close button is not active.
 * Fix – Cleaned up erroneous styles from style.css.
 * Fix – Enqued WordPress Alert Bar style.css eairler to allow plugin stlyes to 
   be overridden using theme stylesheet, without the need for important tags.

#### 1.0.0

_Release Date – May 31 2020_

 * New – Added WordPress Alert Bar to repository.

## 额外信息

 *  版本 **1.0.4**
 *  最后更新：**1 年前**
 *  活跃安装数量 **20+**
 *  WordPress 版本 ** 4.7.0 或更高版本 **
 *  已测试的最高版本为 **6.7.5**
 *  PHP 版本 ** 5.4 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/wp-alert-bar/) 、 [Spanish (Chile)](https://cl.wordpress.org/plugins/wp-alert-bar/)
   和 [Spanish (Spain)](https://es.wordpress.org/plugins/wp-alert-bar/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/wp-alert-bar)
 * 标签
 * [alert](https://cn.wordpress.org/plugins/tags/alert/)[alert bar](https://cn.wordpress.org/plugins/tags/alert-bar/)
   [notice](https://cn.wordpress.org/plugins/tags/notice/)[notification](https://cn.wordpress.org/plugins/tags/notification/)
   [notification bar](https://cn.wordpress.org/plugins/tags/notification-bar/)
 *  [高级视图](https://cn.wordpress.org/plugins/wp-alert-bar/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/wp-alert-bar/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/wp-alert-bar/reviews/)

## 贡献者

 *   [ Ryan Bracey ](https://profiles.wordpress.org/braceomatic88/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/wp-alert-bar/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ryanplugindonations@gmail.com&lc=US&no_note=0&item_name=Support+this+developer&cn=&curency_code=USD)