One of the optional features of Genesis is a site map. The contents of the Genesis site map, in order, are:
- a list of all Pages
- a list of all categories
- a list of all authors
- a list of monthly Post archives
- the 100 most recent Posts
The function to output the site map is
genesis_sitemap. You can call it up directly or add it to an action hook.
You will want to use a hook to control where to output the site map. Just replace
your_desired_hook in the example below with the name of your desired hook.
You can optionally specify the HTML tag you would like the subheadings to be marked up with. If you don’t, the default is H2. Again, replace
your_desired_hook with the name of your desired hook.
This function accepts one argument, which is the tag to mark up the subheadings for each section. The argument is optional and the default is
This function does not return a value, but echoes the site map instead.
There is one filter on the output of this function, which is
genesis_sitemap_output. This filter is applied to the entire content of the site map immediately before echoing.
You can create a site map page by selecting Archive under the Page Templates section when creating your Page. This will add a Genesis site map in place of the usual content.
If your child theme supports the
404-page accessibility feature, the site map will also be added to your 404 page.
genesis_sitemap has been included since version 2.2.0.
genesis_sitemap is located in lib/functions/general.php.