Skip to content

Instantly share code, notes, and snippets.

@reasonstousegenesis
Created October 25, 2015 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reasonstousegenesis/c0de9adee2a1868587bc to your computer and use it in GitHub Desktop.
Save reasonstousegenesis/c0de9adee2a1868587bc to your computer and use it in GitHub Desktop.
Replace the default site map with Genesis
<?php
// Paste the code BELOW this line into your child theme functions.
/**
* Replace the default site map with Genesis
*
* @author Reasons to Use Genesis
* @link http://reasonstousegenesis.com/genesis-sitemap-output/
*/
add_filter( 'genesis_sitemap_output', 'rtug_replace_sitemap' );
function rtug_replace_sitemap() {
$sitemap = '<p>Below is a list of our main pages.</p><ul>';
$sitemap .= wp_list_pages( 'title_li=&depth=1&echo=0' );
$sitemap .= sprintf( '</ul><a href="%s">Back Home</a>', home_url() );
return $sitemap;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment