內容簡介
想在特定頁面顯示不同的小工具嗎?
如果安裝這個外掛,您可以創建一個微件區域(側邊欄),並將其替換或串連到現有的微件區域。
您可以在不接觸主題的情況下創建新的微件區域。
您可以通過指定特定頁面、分類或標籤來顯示所創建的微件區域。
使用方式
在 外觀 > 微件區域 中創建一個微件區域
通過 WordPress 的 外觀 > 微件 選單將小工具放入創建的微件區域中
設定描述
微件區域文章類型設定的說明。
側邊欄定義
每個對應到 register_sidebar() 的參數。
register_sidebar(array(
'name' => 名稱
'description' => 描述
'class' => 類別
'before_widget' => 微件區域之前/之後的內容
'after_widget' => 微件區域之前/之後的內容
'before_title' => 微件標題之前/之後的內容,標題類別
'after_title' => 微件標題之前/之後的內容
));
顯示
操作
手動、合併、替換
設置顯示位置有三種選項:手動、合併、替換。
目標小工具
如果您選擇合併或替換操作,這是執行操作的微件區域設置。
位置
如果您選擇合併操作,這是顯示在微件區域之前或之後的設置。
例 1
操作:合併
目標小工具:主頁面
位置:在之後
所以,這個微件區域將在主頁面微件區域之後顯示。
例 2
操作:替換
目標小工具:側邊欄
那麼這個微件區域將顯示在側邊欄微件區域的位置。
但是,如果保留例子 2,側邊欄將在所有頁面上被替換。
因此,在條件回合框中設置條件。
條件
顯示微件區域的條件。
您可以在“文章”選項卡中指定文章 ID,並在“類別”選項卡中指定類別。
例如,在示例 2 的條件下,進一步
可見範圍:選擇頁面
文章和頁面:98765
然後,只有帶有文章 ID 98765 的文章的側邊欄可以顯示此微件區域,而不是側邊欄微件區域。
同樣,在示例 2 的條件下。
可見範圍:選擇頁面
專有詞:未分類
那麼,只有屬於未分類類別的文章可以顯示此微件區域,而不是側邊欄微件區域。
其他兩個是操作“手動”的選項。
PHP 代碼
此微件區域將顯示在此代碼所在的位置。
它應該是通過將其粘貼到主題上使用。
短碼
此微件區域將顯示在此代碼所在的位置。
您可以在任何地方使用它,例如文章和自訂 HTML 的微件。
外掛標籤
開發者團隊
原文外掛簡介
Want to display different widgets on a particular page only?
If you install this plugin, you can create a widget area(sidebar) and replace or concatenate it with an existing widget area.
You can create a new widget area without touching the theme.
You can display the created widget area by specifying a specific page, category, or tag.
How To Use
Create a widget area in Appearance > Widget Areas
Put the widget in the created widget area through Appearance > Widgets menu in WordPress
Description of settings
A description of the widget area post type settings.
Sidebar Definitions
Each corresponds to the argument of the register_sidebar().
register_sidebar(array(
'name' => Name
'description' => Description
'class' => Class
'before_widget' => Before/After Widget
'after_widget' => Before/After Widget
'before_title' => Before/After Widget Title, Title Class
'after_title' => Before/After Widget Title
));
Display
Action
Manual, Merge, Replace
There are three options for setting the display position: Manual, Merge, Replace.
Target Widget
If you select Merge or Replace in the Action, it is the setting for which widget area to perform the action.
Position
If you select Merge in the Action, it is the setting to display before or after the widget area.
Example 1
Action: Merge
Target widget: Home page
Position: After
Then, this widget area will be displayed after the home page widget area.
Example 2
Action: Replace
Target Widget: Sidebar
Then this widget area will be displayed instead of the sidebar widget area.
However, if you keep Example 2, the sidebar will be replaced on all pages.
Therefore, set the condition in the Conditions meta box.
Conditions
It is a condition that the widget area is displayed.
You can specify the post ID on the “Post” tab and the category on the “Term” tab.
For example, under the condition of Example 2, further
Visibility Range: Select Pages
Posts & Pages: 98765
Then, only the sidebar of the post with post ID 98765 can display this widget area instead of the sidebar widget area.
Also, under the conditions of Example 2.
Visibility Range: Select Pages
Term: Uncategorized
Then, only articles belonging to the uncategorized category can display this widget area instead of the sidebar widget area.
The other two are for the action “Manual”.
PHP Code
This widget area will be displayed where this code is located.
It is supposed to be used by pasting it on the theme.
Shortcode
This widget area will be displayed where this code is located.
You can use it anywhere, such as articles and custom HTML for widgets.
