跳到内容

List Child Pages Shortcode

v1.6.3

Douglas Karr · 2018年7月12日 上架

List a page's child pages anywhere with one shortcode, with optional featured images, excerpts, custom ordering, and CSS classes.

正在使用
600+
评分
5.0 / 5
累计下载
1.1 万
最近更新
2026年11月22日
3 条评价需要 WordPress 4.6+已测试到 7.1.5PHP 7.4+

贡献者

截图

The [listchildpages] shortcode in a Shortcode block, sorted by menu order with featured images.
The [listchildpages] shortcode in a Shortcode block, sorted by menu order with featured images.
The published list of child pages with featured images and excerpts (Twenty Twenty-Five, with a few lines of theme CSS for the thumbnails).
The published list of child pages with featured images and excerpts (Twenty Twenty-Five, with a few lines of theme CSS for the thumbnails).

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"]
<h3>Here are our child pages:</h3>
[/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"]
<h3>Here are our child pages:</h3>
[/listchildpages]

Example 3: Target a specific parent page by ID and use medium-sized images:

[listchildpages parent="123" displayimage="yes" size="medium"]
<h3>Resources</h3>
[/listchildpages]

Example 4: Target a parent page by slug and show full-size featured images:

[listchildpages parent="about/company" displayimage="yes" size="full"]
<h3>Team Sections</h3>
[/listchildpages]

Example 5: Follow the page order set under Page Attributes:

[listchildpages orderby="menu_order"]
<h3>Chapters</h3>
[/listchildpages]

Example 6: Explicitly set the parent as the current page and use large images:

[listchildpages parent="current" displayimage="yes" size="large"]
<h3>Subpages</h3>
[/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.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums