The list pages shortcode is designed to allow you to put a list of pages into a page or post. This can create a table of contents to show child pages or a list of child pages for a particular page. The page list created dynamically so the links and page titles should always be updated to the content saved in WordPress.
The simplest example is to just use the following shortcode on a page that has sub-pages or child pages. This will create a simple list with a Contents header.
The page list can be manipulated with some attributes to do more complicated page lists.
[list-pages child_of=17 toc_title_text="Procedures"]
The list is more complicated, and you may need help to determine the proper ID number, but this can be useful to list pages without having to manually create links. Here is a list of the attributes and short descriptions.
- show_date – Shows the date the page was published.
- date_format – Sets the date for show_date.
- depth -Hierarchy depth (default of 0 is infinite).
- child_of -The page ID to use as the main parent (default is the current page).
- exclude -List of page ID numbers separated by commas to exclude.
- include – List of page ID numbers spearated by commas to include.
- title_li – Puts a line of text and an additional list wrapped around the page list.
- authors – To show pages by a certain author.
- sort_column – Sets the order of the pages (default is page order then alphabetically by title).
- link_before – Adds extra text or HTML before links.
- link_after – Adds extra text or HTML after links.
- exclude_tree – List of page ID numbers separated by commas that will exclude the parent and all child pages of that parent.
- toc_container_tag – Sets the container HTML tag for the whole page list (default is a DIV).
- toc_container_class – Sets the HTML CSS class for the container tag (default is list-pages-container).
- toc_title_tag – Sets the HTML tag used for the title of the whole page list (default is H3).
- toc_title_class – Sets the HTML CSS class for the title HTML tag (default is list-pages-title).
- toc_title_text – Sets the text used as the title for the whole page list (default is Contents).
- toc_wrapper_tag – Sets the tag wrapped around the list of pages (default is UL).
Many of these options are unnecessary for basic page lists, so make sure to contact the Website Manager about any advanced options.