Home Plugins list child pages shortcode
List Child Pages Shortcode logo

List Child Pages Shortcode

by douglaskarr on WordPress.org

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

(3)
View of the shortcode.

View of the shortcode.

I could not find an easy plugin that enabled me to use a shortcode that would enable me to publish a list of child pages under a parent page. So, I built one.

Usage

The shortcode is [listchildpages]...[/listchildpages]. It accepts several attributes:

  • ifempty: Message or HTML to show if no child pages exist.
  • order: ASC or DESC. Default: DESC.
  • orderby: Field to order by. Default: publish_date (maps to date). Any valid WP_Query orderby value works.
  • displayimage: Show featured image (yes|no). 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: Explicitly set the parent as the current page and use large images:
[listchildpages parent=”current” displayimage=”yes” size=”large”]

Subpages

[/listchildpages]

The shortcode accepts all of the Order and Orderby Parameters listed within the WordPress class reference.

Built by DK New Media, visit MarTech to keep up on this plugin and other marketing tools to help you grow your online presence!

Active installations600+
Weekly downloads
6-50.00%
Version1.4.1
Last updated9/24/2025
WordPress version3.0.1
Tested up to6.7.3
Tags
child pagepageparent pageshortcode