HTML Sitemap is an important page of a website. It is significantly improved version than default WordPress StudioPress Genesis supplied archive template. Here is a Free WordPress Genesis HTML Sitemap With Responsive Column PHP Template For the Genesis Users. Simply you need to drop it via FTP & select a template from WordPress Post editor.
Features of WordPress Genesis HTML Sitemap With Responsive Columns
Live demo of sitemap is here. We have listed only the latest 100 posts, not all posts ever published. We talked before about how to list all the posts on WordPress. It is not difficult but wastage of resources of the server. You can modify your’s own and add pagination. It is meaningless because we have categories, tags. Regarding features, it has responsive columns as you can see. That CSS is inline, no Javascript or external CSS is called. Rest of the design will be handled by the Genesis framework or child theme.
We have removed the odd kinds of stuff of default StudioPress Genesis archive pages towards the bottom like Author-named archive, added RSS Feed, added responsive CSS columns for monthly archives and pages, added horizontal lines etc.
---
On a full desktop browser, you’ll see three columns, on browsers lesser than 1139px, you’ll see two columns, on browsers lesser than 480px, you’ll see one column.
We talked about CSS Columns, it is CSS which is automatically breaking the list in to nice columns. Very old browsers may not support.
How To Use WordPress Genesis HTML Sitemap?
Easy. If your child theme’s name is Metro, and the path is wp-content/themes/metro
. Then go to that location via FTP or SSH. We are supplying you a PHP file named page_archive.php
. List the files and make sure that another custom file is not in place, if such present, rename that.
We have a full GitHub repo for that WordPress Genesis HTML Sitemap. Download only the page_archive.php
as RAW text and save as page_archive.php
. Basic questions are answered on that repo. Then, from WordPress administration backend, create a Page named archive or sitemap, choose Sitemap as a template from WordPress Editor’s Page Attributes > Template > [Dropdown] > Sitemap. Save the page and publish it. That’s it. In Github repo, basics on how to edit are written.
You’ll notice that, in our sitemap some text added. That is added via editing the template after these lines with HTML p tag :
1 2 | function genesis_page_archive_content() { ?> <?php echo genesis_html5() ? '<article>' : '<div>'; ?> |
Full PHP Template of WordPress Genesis HTML Sitemap
For practical reasons, we are hosting the code on this page, but you should use GitHub’s that repo :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | <?php /** * Genesis Framework. * * WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances. * Please do all modifications in the form of a child theme. * * @package Genesis\Templates * @author The Customize Windows * @license GPL-2.0+ * @link https://thecustomizewindows.com/ */ //* 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 all pages, * categories, authors, monthly archives, and recent posts. * * @since 1.6 */ function genesis_page_archive_content() { ?> <?php echo genesis_html5() ? '<article>' : '<div>'; ?> <style> .thecustomizewindows-custom{ margin-bottom: 1em !important; margin-top: 1em !important; column-count: 3; column-gap: 10 px; column-rule-color: #0274BE; column-rule-style: outset; column-rule-width: 1px; box-sizing: border-box; display: block; line-height: 1.5; } @media only screen and (max-width: 1139px) { .thecustomizewindows-custom { column-count: 2;} } @media only screen and (max-width: 480px) { .thecustomizewindows-custom { column-count: 1;} } </style> <h2><?php _e( 'Monthly:', 'genesis' ); ?></h2> <hr> <div class="thecustomizewindows-custom"> <ul> <?php wp_get_archives( 'type=monthly' ); ?> </ul> </div> <hr> <h4><?php _e( 'Recent 100 Posts:', 'genesis' ); ?></h4> <ul> <?php wp_get_archives( 'type=postbypost&limit=100' ); ?> </ul> <hr> <div class="thecustomizewindows-custom"> <h4><?php _e( 'Pages:', 'genesis' ); ?></h4> <ul> <?php wp_list_pages( 'title_li=' ); ?> </ul> </div> <hr> <h4><?php _e( 'Categories:', 'genesis' ); ?></h4> <ul> <?php wp_list_categories( 'sort_column=name&title_li=' ); ?> </ul> <h4><?php _e( 'Authors:', 'genesis' ); ?></h4> <ul> <?php wp_list_authors( 'exclude_admin=0&optioncount=1' ); ?> </ul> <h4><?php _e("Site Feeds", "genesis"); ?></h4> <ul> <li><a href="<?php bloginfo('rss2_url'); ?>"><?php _e("Main RSS Feed", "genesis"); ?></a></li> </ul> <p style="text-align: right;"><span style="color: #999;">dEVELOPED by <a title="The Customize Windows" href="https://thecustomizewindows.com/" target="_blank">The Customize Windows</a></span></p> <?php echo genesis_html5() ? '</article>' : '</div>'; } genesis(); |