[WordPress] 外掛分享: DMG Related Pages Widget

首頁外掛目錄 › DMG Related Pages Widget
30+
安裝啟用
尚無評分
3494 天前
最後更新
問題解決
WordPress 3.1+ v1.1.1 上架:2016-08-04

內容簡介

這是一個簡單的小工具,用來顯示和當前頁面相關的頁面列表。

您可以選擇顯示同級的頁面、子頁面或兩者,並設置要顯示多少級子頁面。

您也可以輸入要應用於小工具包裝器或列表 (ul 元素) 的類別。

如果小工具位於非階層結構的頁面上,或者沒有相關頁面,則不會顯示任何內容。

有一個掛鉤可用於過濾標題:dmg_related_pages_widget_title。

例如,如果要在單個頁面或文章上更改標題,您可以將以下內容添加到您的 functions.php 文件中:

function myTitleFilter( $title )
{
if( is_singular() )
{
return "<strong>$title</strong>";
}
else
{
return $title;
}
}
add_filter( 'dmg_related_pages_widget_title' , 'myTitleFilter');

更多有關此外掛的資訊可在http://dancoded.com/wordpress-plugins/related-pages-widget/找到。

添加 CSS 類別

輸入字串,可以用空格或逗號分隔,這些字串將應用為 CSS 類別,包括小工具和/或列表包裝器。這些類別使用 WordPress 中內置的 sanitize_html_class() 函數進行消毒。

使標題成為連結

輸入有效的 URL 以使標題成為連結。

外掛標籤

開發者團隊

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

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

原文外掛簡介

A simple widget that displays a list of pages related to the current page.
You can choose to show either siblings pages (on the same level), child pages or both, and set how many levels of child pages to show.
You can also enter class(es) to be applied to the widget wrapper or the list (ul element).
If the widget is on a page that is not hierarchical, or if there are no related pages, nothing is displayed.
A hook is available to filter the title: dmg_related_pages_widget_title.
For example, to change the title on a single page or post, you could add this to your functions.php file:
function myTitleFilter( $title )
{
if( is_singular() )
{
return "$title";
}
else
{
return $title;
}
}
add_filter( 'dmg_related_pages_widget_title' , 'myTitleFilter');

More information about this plugin can be found at http://dancoded.com/wordpress-plugins/related-pages-widget/.
Adding CSS Class(es)
Enter strings, either space or comma seperated, which will be applied as CSS classes to the widget wrapper and/or the list wrapper. These classes are sanitized using the sanitize_html_class() function built in to WordPress.
Make the Title a link
Enter a valid URL to make the title a link.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon