Sub-Pages

The Sub-Pages shortcode for WordPress can be used to list child pages of a set ID page or of the current page if no ID is set. Check below for example implementations and shortcode documentation:

Sub-Pages Examples

Sub-Pages Shortcodes

Shortcode
[x3m-subpage pageid="1" maxentries="10" column="2"]
The shortcode can be used to list child pages / sub-pages of a set page ID or of current page. Only first-level child pages will be included in the list. The list can be limited to a number of entries and display can be set in columns. Above example lists the sub-pages of our “WP Plugins” page.

Sub-Pages Documentation

Here are the shortcode option settings available for Sub-Pages:

Shortcode Settings Details
pageid=”1″

optional

This is used to set the page ID for which page the child pages will be listed.

If no pageid is set, it will pull sub-pages of the current page (where the shortcode is published).

maxentries=”10″

optional

This is used to set the maximum number of sub-pages to be included in the list. Pages are ordered alphabetically.

If no maxentries is set, it will display all sub-pages of the page.

columns=”2″ This is used to set the number of columns used to display the list.

The values accepted are “1”, “2” or “3”. For high number of sub-pages to be listed, it is advisable to display them in columns.

pagination=”yes”

optional

This is used to add a pagination to the displayed list. If the list contains more items than the number of columns * max entries, then it will include a pagination at the bottom of the list.

Value accepted is “yes”.

The Sub-Pages shortcode can be implemented in any content inside WordPress. However, for it to display a list of sub-pages, it would be required to set the pageid parameter. The pageid parameter is not required if the shortcode is implemented in a page, pulling its current sub-pages. Implementation in any other content type (ex Post or Custom Post) without a pageid parameter will return an error message.