WP Manifestindependent plugin directory
manifest / content / jsm-list-pages-shortcode

JSM List Pages Shortcode

JSM List Pages Shortcode (WordPress Plugin)

by JS Morisset · github.com/jsmoriss/jsm-list-pages-shortcode · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/jsmoriss/jsm-list-pages-shortcode/archive/refs/heads/main.zip

JSM List Pages Shortcode

Plugin NameJSM List Pages Shortcode
Summary[list-pages], [sibling-pages] and [child-pages] shortcodes to list pages in the content.
Stable Version1.0
Requires PHP7.4.33 or newer
Requires WordPress6.0 or newer
Tested Up To WordPress7.1.1
Contributorsjsmoriss
LicenseGPLv3
Tags / Keywordsshortcode, list pages, sibling pages, child pages, subpages

Description

[list-pages], [sibling-pages] and [child-pages] shortcodes to list pages in the content.

Example Usage

List pages sorted by title:

[list-pages sort_column="post_title"]

List pages but exclude certain IDs and set the class of the list to "my-page-list":

[list-pages exclude="17,38" class="my-page-list"]

Show excerpt:

[list-pages excerpt="1"]

List the current page's children, but only show the top level:

[child-pages depth="1"]

List the current page's siblings and their subpages:

[sibling-pages depth="2"]

Default Arguments

The default values are the same as for the wp_list_pages() function except for title_li which defaults to nothing. If a class is not specified, a default class of either "list-pages", "sibling-pages" or "child-pages" is given to the UL tag. In addition, the echo parameter has no effect.

In addition to the wp_list_pages() arguments, you can also specify:

  • list_type (string) List tag. Defaults to <ul>.
  • exclude_current_page (int) Exclude the current page. Defaults to 0.
  • excerpt (int) Show the page excerpt. Defaults to 0.