[WordPress] 外掛分享: List Pages Shortcode

首頁外掛目錄 › List Pages Shortcode
WordPress 外掛 List Pages Shortcode 的封面圖片
5,000+
安裝啟用
★★★★
4.9/5 分(14 則評價)
1123 天前
最後更新
問題解決
WordPress 4.4.0+ v1.7.7 上架:2009-03-03

內容簡介

介紹了 [list-pages]、[sibling-pages] 和 [child-pages] 短碼,方便在文章中顯示頁面清單。這兩個短碼可以接受您傳遞給 wp_list_pages() 函數的所有參數,此外還添加了一個 class 參數。

使用範例

按標題排序頁面清單

[list-pages sort_column="post_title"]

列出頁面但排除某些 ID,並將清單的 class 設置為「my-page-list」

[list-pages exclude="17,38" class="my-page-list"]

顯示文章摘要(對於不存在摘要支援的頁面,需要手動添加或通過 Page Excerpt 外掛程式添加)

[list-pages excerpt="1"]

列出當前頁面的子項,但僅顯示頂層

[child-pages depth="1"]

列出當前頁面的同級頁面及其子頁面

[sibling-pages depth="2"]

預設引數

預設值與 wp_list_pages() 函數相同,除了 title_li 預設為空。如果沒有指定 class,UL 標籤會自動分配一個預設的 class,分別為「list-pages」、「sibling-pages」或「child-pages」。此外,echo 參數沒有效果。

除了 wp_list_pages() 的參數外,您還可以指定:

list_type(字串)清單標籤,預設為 <ul>。
exclude_current_page(整數)排除當前頁面。預設為 0。
excerpt(整數)顯示頁面摘要。預設為 0。

外掛標籤

開發者團隊

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

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

原文外掛簡介

Introduces the [list-pages], [sibling-pages] and [child-pages] shortcodes for easily displaying a list of pages within a post or page. Both shortcodes accept all parameters that you can pass to the wp_list_pages() function with the addition of a class parameter.
Example Usage
List pages sorted by title
[list-pages sort_column="post_title"]

List pages but exclude certain IDs and set the class of the list to “my-page-list”
[list-pages exclude="17,38" class="my-page-list"]

Show excerpt (for pages excerpt support will need adding manually or via the Page Excerpt plugin)
[list-pages excerpt="1"]

List the current page’s children, but only show the top level
[child-pages depth="1"]

List the current page’s siblings and their subpages
[sibling-pages depth="2"]

Default Arguments
The default values are the same as for the wp_list_pages() function except for title_li which defaults to nothing. If a class is not specified, a default class of either “list-pages”, “sibling-pages” or “child-pages” is given to the UL tag. In addition, the echo parameter has no effect.
In addition to the wp_list_pages() arguments, you can also specify:

list_type (string) List tag. Defaults to

文章
Filter
Apply Filters
Mastodon