[page_sitemap]
The shortcode displays a sitemap of WordPress pages.
Product
Shortcode Attributes
- title – The title to display above the sitemap
- Options: Any text value.
- layout – The layout style for the sitemap.
- Options:
1,2(not styled yet).
- Options:
- order – The order in which the pages are listed.
- Default:
title. - Options:
ID,title,author,date,modified,parent,menu_order,random. Specify one only.
- Default:
- exclude – A comma-separated list of page IDs to exclude from the sitemap.
- Options: Any numeric value.
Example Usage
[page_sitemap]
[page_sitemap title="Our Site Pages" layout="2" order="date" exclude="5,10"]
Results
| Example 1 This example will generate a sitemap of all pages on your site using the default settings. Example 2 This example will generate a sitemap with the title “Our Site Pages”, using a compact layout, ordered by the date the pages were published, and excluding pages with IDs 5 and 10. |
order attribute is automatically prefixed with post_ if it is one of the following: title, author, date, modified, or parent. This ensures compatibility with the wp_list_pages function.