[post_sitemap]
The shortcode displays a sitemap of posts.
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_taxonomies – Comma-separated list of taxonomies to exclude from the sitemap.
- Options: Any text value.
- hierarchical – Whether to display posts hierarchically (if applicable).
- Default:
on. - Options:
on,off. Specify one only.
- Default:
Example Usage
[post_sitemap]
[post_sitemap title="My Post Sitemap" layout="2" order="date" exclude_taxonomies="category,tag" hierarchical="off"]
Results
| Example 1 This example will generate a sitemap of all posts using the default settings. Example 2 This example generates a sitemap with a custom title, uses a compact layout, sorts posts by date, excludes posts from the “category” and “tag” taxonomies, and disables hierarchical display. |
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 hi_list_posts function.