
內容簡介
功能:
使用短碼(shortcode)並使用側邊欄名稱或 ID,將側邊欄新增至 WordPress 文章和頁面。
新增一個或多個自訂類別以符合您的佈景主題風格或自訂 CSS 風格(選用)。
如何使用:
方法 1 -(建議使用:使用側邊欄名稱添加側邊欄)
側邊欄名稱可在 WordPress 管理員區域的 外觀 > 小工具 部分中找到。
範例:
[sidebar name="your-sidebar-name"]
[sidebar name="your-sidebar-name" class="custom-class"]
[sidebar name="your-sidebar-name" class="custom-class-1 custom-class-2 custom-class-3"]
方法 2 -(高級 WP 使用者:使用側邊欄 ID 添加側邊欄)
側邊欄 ID 可在您的主題的 register_sidebar 函数中找到,通常位於主題的 functions.php 文件中。
範例:
[sidebar id="your-sidebar-id"]
[sidebar id="your-sidebar-id" class="custom-class"]
[sidebar id="your-sidebar-id" class="custom-class-1 custom-class-2 custom-class-3"]
一般注意事項:
短碼(shortcode)名稱或 ID 的拼字和大小寫必須與所需的側邊欄完全匹配。
活躍側邊欄的定義:包含小工具的側邊欄。
不帶有活動側邊欄名稱或 ID 的 [sidebar] 短碼將不顯示任何內容。
如果同一個短碼中同時存在活動的側邊欄名稱和 ID,則活動側邊欄 ID 將優先於側邊欄名稱。
可在同一頁面或文章中使用多個短碼(shortcode)。
同一個側邊欄短碼(shortcode)可以多次使用在同一頁面或文章上。
HTML 類別注意事項:
使用空格字符分隔多個自定義類別。參見上面的「方法」章節中的範例。
可使用的自定義類別數量沒有限制。
每個自訂類別必須僅包含(字母,數字,-,_)字符,否則所有自訂類別都會被省略。
如果側邊欄 ID 只包含(字母,數字,-,_)字符,則永遠會將其添加到 HTML 類別屬性中。
演示:
訪問外掛 URI
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
Features:
Add sidebars to WP Posts and Pages with shortcodes using a sidebar Name or sidebar ID.
Add one or more optional custom classes to match your theme styles or custom CSS styles.
How to Use:
Method 1 – (Recommended Use: Add a sidebar using a sidebar Name.)
A sidebar Name can be found in the Appearance > Widgets section of your WordPress Admin Area.
Example uses:
[sidebar name="your-sidebar-name"]
[sidebar name="your-sidebar-name" class="custom-class"]
[sidebar name="your-sidebar-name" class="custom-class-1 custom-class-2 custom-class-3"]
Method 2 – (Advanced WP Users: Add a sidebar using a sidebar ID.)
A sidebar ID can be found in your theme’s register_sidebar functions, usually in the theme’s functions.php file.
Example uses:
[sidebar id="your-sidebar-id"]
[sidebar id="your-sidebar-id" class="custom-class"]
[sidebar id="your-sidebar-id" class="custom-class-1 custom-class-2 custom-class-3"]
General Notes
The spelling and capitalization of a shortcode Name or ID must exactly match that of the desired sidebar.
Definition of an active sidebar: An active sidebar is a sidebar that contains widgets.
A [sidebar] shortcode without an active sidebar Name or active sidebar ID displays nothing.
An active sidebar ID overrides a sidebar Name if both are present in the same shortcode.
There is no limit to the number of shortcodes that can be used on the same page or post.
The same sidebar shortcode can be used multiple times on the same page or post.
HTML Class Notes
Separate multiple custom classes using a space character. Examples shown in Method sections above.
There is no limit to the number of custom classes that can be used.
Each custom class must only contain (letter,number,-,_) characters, otherwise all custom classes are omitted.
The sidebar ID is always added to the HTML class attribute if it contains only (letter,number,-,_) characters.
Demo:
Visit Plugin URI
