sandywp / plugins / list-child-pages-shortcode
List Child Pages Shortcode
List a page's child pages anywhere with one shortcode, with optional featured images, excerpts, custom ordering, and CSS classes.
Ready in seconds.
v1.6.3 600+ installs WP 4.6+ PHP 7.4+

What you get inside
2 screens-
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).
About this plugin
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:
ASCorDESC. Default:DESC, orASCwhenorderby="menu_order". - orderby: Field to order by. Default:
publish_date(maps todate). Also acceptspublished(maps todate),title,name,modified,menu_order,ID,rand,type, andauthor. Usemenu_orderto follow the Order numbers set under Page Attributes; pages with the same number sort by title. - displayimage: Show featured image (
yes|no). Also acceptsy,true,1, andon. 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
currentto 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; usedknm_lcp_html.
Built by DK New Media. Visit Martech Zone for updates on this plugin and other marketing tools.
Questions
- How can I add a description for each child page?
Edit the child page and you’ll find an excerpt section where you can enter a description that will be published on the list.
- How can I enable featured images on my site?
Within your functions.php file, look for the add_theme_support post-thumbnails line and add page to the array. Or if you don’t have that line, you can just add it:
add_theme_support( 'post-thumbnails', array( 'post', 'page' ) );- How can I modify the output?
There are additional class fields for the unordered list tag (ulclass), list item tag (liclass), and the anchor tag (aclass). You can modify the output utilizing your theme’s CSS.
- How do I list child pages in my own order?
Set the Order number under Page Attributes on each child page (1, 2, 3…), then use
[listchildpages orderby="menu_order"]. Since 1.6.0 this sorts lowest number first. Addorder="desc"to reverse it.- I updated to 1.6.0. Do I need to change my shortcodes?
No.
[listchildpages]and every attribute work as before. The only change in output is thatorderby="menu_order"without anorderattribute now sorts ascending, which matches the order shown in WordPress.- What happens if I deactivate or uninstall the plugin?
The plugin stores nothing in the database. An uninstall.php file defensively removes any leftover
dknm_lcp_or legacydklcp_options or transients if they were ever created. Your pages, excerpts, and featured images are not changed. Shortcodes left in content will simply stop rendering until the plugin is activated again.
sandywp / also on the shelf
Try another plugin
4.9 · 9K+ installs
Display WordPress child pages in a responsive grid or list using a shortcode, Gutenberg block or Elementor widget.
4.9 · 5K+ installs
Introduces the [list-pages], [sibling-pages] and [child-pages] shortcodes for easily displaying a list of pages within a post or…
4.9 · 1K+ installs
Easily password protect the child pages/posts of a post/page that is password protected.
Spin up a real WordPress site in seconds.
Test plugins, build a demo, hand a client a link — then squash it and start again. No local setup, no Docker.