[WordPress] 外掛分享: Easy Widget Columns

首頁外掛目錄 › Easy Widget Columns
WordPress 外掛 Easy Widget Columns 的封面圖片
400+
安裝啟用
★★★★★
5/5 分(5 則評價)
2052 天前
最後更新
問題解決
WordPress 4.6+ PHP 5.6+ v1.2.4 上架:2017-03-07

內容簡介

Easy Widget Columns 讓您輕鬆地將小工具排列成列。它使用新的“列寬度”選項,讓您可以為每個小工具設置寬度值。您可以使用“Widget Row”小工具和“Sub-Row”小工具來定義小工具列的新行和子行,從而直接在小工具區域或側邊欄中創建複雜的佈局。Genesis 框架用戶請務必查看“Widgetized Page Template”外掛,它可以幫助您創建全頁小工具區域,可作為與 Easy Widget Columns 一起使用的“空白畫布”。

大多數佈景主題均適用於 Easy Widget Columns,並已優化用於 Genesis 框架,但並不是必需的。它使用 Genesis Framework 的列類來顯示小工具列。如果您的佈景主題已經包含了Genesis FrameWork的列類別或者您想手動添加或編輯CSS,則可以選擇不在“設置”>“Widget Columns”中加載CSS,並依賴於佈景主題的樣式表。此選項建議用於大多數 Genesis 用戶或關注在其網站上加載其他資產的用戶。

插件支援 RTL 佈局和翻譯。您可以使用以下篩選器完全控制該插件的佈景主題,其中 ewc_include_widgets 為白名單篩檢器,用於僅將寬度控制添加到指定的圖表中,而 ewc_exclude_widgets 則為黑名單篩選器,用於從指定的應用程式中刪除寬度控制等等。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.2.4) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Easy Widget Columns」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Easy Widget Columns makes it really easy to arrange your widgets in rows of columns. It works by adding a new ‘Column width’ select option at the bottom of your widget’s form that allows you to set a width value for each widget.
You can define new rows and sub-rows of widget columns with the ‘Widget Row’ widget and the ‘Sub-Row’ widget respectively, allowing you to create complex layouts directly from within your widget area or sidebar.

Genesis Framework users, be sure to check out the Widgetized Page Template plugin, which helps you create full-page widget areas to use as a “blank canvas” with Easy Widget Columns.

Works With Most Themes
Easy Widget Columns is optimized for use with the Genesis Framework, but it is not required. It uses the Genesis Framework Column Classes to display your widgets in rows of columns. If your theme already incorporates the Genesis Framework Column Classes, or you want to manually add or edit the CSS, you can choose not to load the CSS under ‘Settings’ > ‘Widget Columns’ and rely on your theme’s stylesheet instead. This option is recommended for most Genesis users or those concerned with loading additional assets on their website.
Translation and RTL Ready
The plugin supports RTL layouts and is translation ready.
Filters for Developers
The following filters are available for you to take full control of the plugin on your themes.

ewc_include_widgets – This whitelist filter is used to add the width control ONLY to the specified widgets.
ewc_exclude_widgets – This blacklist filter is used to remove the width control from the specified widgets.
ewc_color_palette – This filter allows you to add a custom color palette to the color picker control in the ‘Widget Row’ widget.
ewc_preset_classes – This filter allows you assign preset CSS classes that display as a checkbox list in the ‘Widget Row’ widget.
ewc_advanced_options – This filter allows you to remove specific or all advanced options from the ‘Widget Row’ widget.

1. ewc_include_widgets / ewc_exclude_widgets
Both filters accept the widget’s ID base as parameters. Please note that you cannot use both filters at once. The ewc_include_widgets filter will always take precedence over the ewc_exclude_widgets filter and overwrite it.
The examples below demonstrate how you can implement these filters on your theme.
add_filter( 'ewc_include_widgets', 'myprefix_add_ewc_control' );
/**
* Filter to add the EWC control to specified widgets.
*
* @param array An empty array.
* @return array An array containing the widget's ID base.
*/
function myprefix_add_ewc_control( $ewc_widgets ) {

$ewc_widgets = array(
'meta', // WP Meta widget
'archives', // WP Archives widget
'calendar', // WP Calendar widget
'categories', // WP Categories widget
);

return $ewc_widgets;

}

add_filter( 'ewc_exclude_widgets', 'myprefix_remove_ewc_control' );
/**
* Filter to remove the EWC control from specified widgets.
*
* @param array An empty array.
* @return array An array containing the widget's ID base.
*/
function myprefix_remove_ewc_control( $ewc_widgets ) {

$ewc_widgets = array(
'recent-comments', // WP Recent Comments widget
'recent-posts', // WP Recent Posts widget
'rss', // WP RSS widget
'tag_cloud', // WP Tag Cloud widget
);

return $ewc_widgets;

}

2. ewc_color_palette
This filter allows you to add a custom color palette to the color picker control in the ‘Widget Row’ widget. It accepts an array of hex color values as parameters.
The example below demonstrates how you can implement this filter on your theme.
add_filter( 'ewc_color_palette', 'myprefix_ewc_color_palette' );
/**
* Filter to edit the color palette in the color picker control.
*
* @param array An empty array.
* @return array An array containing hex color values.
*/
function myprefix_ewc_color_palette( $color_palette ) {

$color_palette = array(
'#252724',
'#ce6b36',
'#31284b',
'#a03327',
'#3b3e3e',
'#67b183',
);

return $color_palette;

}

3. ewc_preset_classes
This filter allows you assign preset CSS classes that display as a checkbox list in the ‘Widget Row’ widget.
The following example demonstrates how you can implement this filter on your theme.
add_filter( 'ewc_preset_classes', 'myprefix_preset_classes' );
/**
* Filter for predefining EWC Widget Row classes.
*
* @param array An empty array.
* @return array An array containing new values.
*/
function myprefix_preset_classes( $classes ) {

$classes = array(
'hero',
'parallax',
'slider',
'content',
);

return $classes;

}

4. ewc_advanced_options
This filter allows you to remove specific or all advanced options from the ‘Widget Row’ widget. This can be useful for limiting design functionality on a client website (decisions, not options).
The following example demonstrates how to completely remove all advanced options.
// Remove all advanced options from the Widget Row widget.
add_filter( 'ewc_advanced_options', '__return_false' );

The example below demonstrates how to disable or enable specific advanced options. The display parameter toggles the advanced option and the active parameter determines if the panel will display open (1) or closed (0) when the Widget Row widget is first added into a widget area.
add_filter( 'ewc_advanced_options', 'myprefix_display_advanced_options' );
/**
* Filter to remove specific advanced options from the Widget Row widget.
*
* @param array An array containing default values.
* @return array An array containing new values.
*/
function myprefix_display_advanced_options( $display ) {

$display = array(
'ewc_background' => array(
'display' => true,
'active' => 1,
),
'ewc_margin' => array(
'display' => false,
'active' => 0,
),
'ewc_padding' => array(
'display' => false,
'active' => 0,
),
'ewc_class' => array(
'display' => true,
'active' => 0,
),
);

return $display;

}

文章
Filter
Apply Filters
Mastodon