Skip to content

Instantly share code, notes, and snippets.

@About2git
Forked from srikat/page_sitemap.php
Last active August 29, 2015 14:15
Show Gist options
  • Select an option

  • Save About2git/3f11e3421c80cc93e72c to your computer and use it in GitHub Desktop.

Select an option

Save About2git/3f11e3421c80cc93e72c to your computer and use it in GitHub Desktop.
Sitemap Template in Genesis. http://cl.ly/image/2p3g2j0B2g0N
<?php
/*
Template Name: Sitemap
*/
//* Remove standard post content output
remove_action( 'genesis_post_content', 'genesis_do_post_content' );
remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
add_action( 'genesis_entry_content', 'genesis_page_archive_content' );
add_action( 'genesis_post_content', 'genesis_page_archive_content' );
/**
* This function outputs sitemap-esque columns displaying
* categories, monthly archives and recent posts.
*/
function genesis_page_archive_content() { ?>
<div class="one-half first">
<h4><?php _e( 'By Category', 'genesis' ); ?></h4>
<ul>
<?php wp_list_categories( 'sort_column=name&title_li=' ); ?>
</ul>
<h4><?php _e( 'By Month', 'genesis' ); ?></h4>
<ul>
<?php wp_get_archives( 'type=monthly' ); ?>
</ul>
</div>
<div class="one-half">
<h4><?php _e( 'By Posts (Last 50 articles)', 'genesis' ); ?></h4>
<ul>
<?php wp_get_archives( 'type=postbypost&limit=50' ); ?>
</ul>
</div>
<?php
}
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment