List Child Pages Shortcode

plugin banner

A plugin to add list of child pages within the content of a parent page.

Author:Douglas Karr (profile at wordpress.org)
WordPress version required:4.6
WordPress version tested:7.2
Plugin version:1.6.4
Added to WordPress repository:12-07-2018
Last updated:19-11-2026
Rating, %:100
Rated by:3
Plugin URI:https://martech.zone/wordpress-list-child-pag...
Total downloads:11 162
Active installs:600+
plugin download
Click to start download

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.


Screenshots
FAQ
ChangeLog