
內容目錄
內容簡介
List Child Pages Shortcode 外掛讓使用者能夠輕鬆地在父頁面下顯示子頁面的列表,透過簡單的短碼設置,提升網站的內容組織與可讀性。
【主要功能】
• 使用短碼 [listchildpages] 輕鬆顯示子頁面
• 支援多種排序方式(如日期、標題等)
• 可選擇顯示特色圖片及其對齊方式
• 支援自訂 CSS 類別以調整樣式
• 可指定父頁面 ID 或路徑
外掛標籤
開發者團隊
原文外掛簡介
List Child Pages Shortcode adds a [listchildpages] shortcode that lists the child pages of the current page, or of any page you choose, as a simple linked list. Each item can show the page’s featured image and excerpt.
Works in any page, post, widget, or template that renders shortcodes.
Choose the parent by ID, slug/path, or the current page.
Sort by date, title, menu order (the Order field under Page Attributes), and more.
Optional featured images at any registered image size.
Add your own CSS classes to the list, items, and links.
No settings, no database tables, no external services, no tracking.
Usage
The shortcode is [listchildpages]...[/listchildpages]. [dknm_list_child_pages] works the same way. It accepts several attributes:
ifempty: Message or HTML to show if no child pages exist.
order: ASC or DESC. Default: DESC, or ASC when orderby="menu_order".
orderby: Field to order by. Default: publish_date (maps to date). Also accepts published (maps to date), title, name, modified, menu_order, ID, rand, type, and author. Use menu_order to follow the Order numbers set under Page Attributes; pages with the same number sort by title.
displayimage: Show featured image (yes|no). Also accepts y, true, 1, and on. Default: no.
align: CSS class to apply to the image (alignleft, alignright, etc.).
ulclass, liclass, aclass: CSS classes for the list, list items, and links.
parent: ID, slug/path, or current to choose the parent page. Default: current.
size: Image size for thumbnails (thumbnail, medium, large, full, or custom size). Default: thumbnail.
Examples:
Example 1: Order the child pages by publish date in descending order:
[listchildpages aclass="" ifempty="No child pages" orderby="publish_date" order="desc" displayimage="no"]
Here are our child pages:
[/listchildpages]
Example 2: Order the child pages by title in ascending order with the page’s featured image aligned left:
[listchildpages orderby="title" order="asc" displayimage="yes" align="alignleft"]
Here are our child pages:
[/listchildpages]
Example 3: Target a specific parent page by ID and use medium-sized images:
[listchildpages parent="123" displayimage="yes" size="medium"]
Resources
[/listchildpages]
Example 4: Target a parent page by slug and show full-size featured images:
[listchildpages parent="about/company" displayimage="yes" size="full"]
Team Sections
[/listchildpages]
Example 5: Follow the page order set under Page Attributes:
[listchildpages orderby="menu_order"]
Chapters
[/listchildpages]
Example 6: Explicitly set the parent as the current page and use large images:
[listchildpages parent="current" displayimage="yes" size="large"]
Subpages
[/listchildpages]
Developer filters
dknm_lcp_html – filter the final HTML. Receives the HTML, the parent page ID, and the normalized attributes.
shortcode_atts_listchildpages – the standard WordPress filter for the shortcode’s attributes.
dklcp/listchildpages/html – the 1.x output filter. It still runs but is deprecated; use dknm_lcp_html.
Built by DK New Media. Visit Martech Zone for updates on this plugin and other marketing tools.
