
內容簡介
透過 WordPress 的即時自訂(customizer)功能,輕鬆地在您的網站上添加自定義頂部通知訊息。此插件允許您輸入通知欄文本和一個可選的按鈕以顯示在文字旁邊,適合用於通知訪問者有關當前銷售、熱門產品、警告或其他重要信息。
Easy Notification Bar 插件使用自 WordPress 5.2.0 引入的「wp_body_open」action hook,可以更好地與已更新以支援此標籤的主題搭配使用。與其他通知欄方案不同的是,此插件將通知欄插入在 body 標籤後,因此它應該在任何編寫良好的主題上完美顯示而不會產生任何衝突。
通知欄預設為「靜態」模式,這意味著它顯示在您的網站頂部,當您向下滾動頁面時,它將變為「隱藏」狀態。這通常對於易用性和 SEO 更好。然而,在 1.4 版中,我們新增了一個新的固定模式(sticky option),您可以在自訂器中啟用它,以便當您向下滾動頁面時,通知欄保持可見。粘性功能使用 CSS 粘性屬性(而非 JavaScript)實現。
雖然默認情況下禁用,但您可以啟用關閉圖示,使訪問者看到一個「x」圖示在頂部欄上,他們可以單擊它來隱藏訊息,並在他們當前和今後的會話中保持隱藏。該功能使用本地儲存 (localStorage) 實現(並非 cookie)。
即時演示:您可以在我們的 More Widgets Plugin Demo 上查看通知欄的即時演示。
功能
整站或僅首頁顯示頂部通知欄。
通過 WordPress 自訂器輕鬆設置。
可選的關閉圖示。
可選的固定顯示。
自訂背景、顏色、文字對齊和字型大小設置。
可選的呼喚按鈕。
響應式設計,使其在移動設備上看起來很好。
極簡代碼。
關閉圖示只需使用原生 JavaScript 即可實現(不需要 jQuery)。
外掛標籤
開發者團隊
原文外掛簡介
Easily add a custom top bar notification message to on your site with live customization options via the WordPress customizer. The plugin allows you to enter your notification bar text as well as an optional button to display next to your text. Perfect for notifying visitors of a current sale, hot product, warnings or other important messages.
The Easy Notification Bar plugin makes use of the newer “wp_body_open” action hook introduced in WordPress 5.2.0 which allows the plugin to work better with any theme that has been updated to support the tag. Contrary to other notice bar solutions which rely on absolute positioning, this plugin inserts the notice bar right after the body tag so it should display perfectly without any conflicts on any well-coded theme.
By default, the notification bar is “static” which means it displays at the top of your site so when you scroll down the page it will become “hidden”. This is generally better for usability and SEO. However, in version 1.4 we added a new sticky option which you can enable in the Customizer so that the notification bar remains visible as you scroll down the page. The sticky functionality makes use of the CSS sticky property (not javascript).
Although disabled by default, you can enable a close icon for your notice. When enabled, your visitors will see an “x” icon over the top bar which they can click to hide the message for their current and future sessions. This functionality makes use of localStorage (not cookies). You can also select to hide the notification bar when clicking the call to action button.
Features
Sitewide (or homepage only) top notification bar.
Easy setup via the WordPress customizer.
Optional close icon.
Optional sticky display.
Custom background, color, text alignment and font size settings.
Optional callout button.
Responsive design so it looks good on mobile.
Minimal code.
Vanilla Javascript used for close icon (jQuery not needed).
