-
-
Save About2git/3f11e3421c80cc93e72c to your computer and use it in GitHub Desktop.
Sitemap Template in Genesis. http://cl.ly/image/2p3g2j0B2g0N
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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