How to Create Custom Archives Page in Genesis Theme

This tutorial is exclusively for Genesis Framework, the best WordPress theme you will ever need. Give it a try and stay ahead of the Crowd. Period.

Share This Article:

Simple tutorial that helps to create custom archives page in Genesis Theme. If you ever want to add an archives page without a plugin, then we recommend to bookmark this article.

create-custom-archives-page-genesis

What is Archives Page ?

In one word archives page is similar to that of a sitemap and it includes all content of your published till date. It is recommended to have an archives page and it helps in terms of SEO and User Experience.

Recommended How to Create Custom 404 Page in Genesis Theme

Create Custom Archives Page in Genesis Theme

If you are already using Genesis Theme then you should have noticed an “Archives Page”, which is available by default. When activated, page display list of Categories, Pages, Monthly Archives and some recent posts. But, if you are using a Genesis Child Theme, then here is how to create custom archives page.

custom-archives-page-genesis

Demo of Archives Page: www.wpsquare.com/archives

Create Page Template in Genesis Theme

First of all you need to create a page template in Genesis and here is the Code that helps to create one. Open Notepad, add below code to it and save it as page_archive.php file.

<?php
/*
Template Name: Archive
*/
//Add Archives Page Content Here

genesis();

You have created a page template with name “Archives” and you can change the name as per your wish.

Learn How to Customize Genesis Post Excerpts

Create Custom Functions for Archives Page

Every page in Genesis runs on Standard loop and hence it is required to unhook the loop or post content from the page. In this case we are using post content and here is the code with for that.

<?php
/*
Template Name: Archive
*/
remove_action( 'genesis_post_content', 'genesis_do_post_content' );
add_action( 'genesis_post_content', 'genesis_page_archive_content' );

function genesis_page_archive_content() { ?>

//Add Archives Page Content Here

<?php
}
genesis();

Default Genesis Post Content is removed and a new one is added using Custom Functions. Now, everything is fine and its time to add some content to archives page.

Check Out Genesis 1.8.2 Now Available for Download

Add Content to Custom Archives Page in Genesis

You need to replace the highlighted code with contents of the custom archive page. You can add Category List,  Drop Down of Monthly Archives and can display all posts. Here are some snippets that help to create custom archives page.

Add Category List to Custom Archives Page

Displays the list of all categories on archives page. You can also exclude any category based on its ID.

<h4><?php _e( 'Categories:', 'genesis' ); ?></h4>
<ul><?php wp_list_categories( 'sort_column=name&title_li=' ); ?></ul>

Display List of All Posts in Archives Page

Here is the simple code snippet that helps to display list of all posts published till date on your blog.

<ul><?php wp_get_archives('type=postbypost'); ?> </ul>

Display Drop-Down Monthly Archives

Another interesting code that adds a drop-down menu for monthly archives.

<select name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
<option value=""><?php echo esc_attr( __( 'Select Month' ) ); ?></option>
<?php wp_get_archives( 'type=monthly&format=option&show_post_count=1' ); ?>
</select>

Wrapping Up all this Code – Custom Archives Page

Here is the complete code that helps to create a custom archive page. Copy this code to notepad and save it as page_archive.php file. Now, upload this file to your Genesis Child Theme Folder.

<?php
/*
Template Name: Archive
*/
remove_action( 'genesis_post_content', 'genesis_do_post_content' );
add_action( 'genesis_post_content', 'genesis_page_archive_content' );

function genesis_page_archive_content() { ?>

<select name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
<option value=""><?php echo esc_attr( __( 'Select Month' ) ); ?></option>
<?php wp_get_archives( 'type=monthly&format=option&show_post_count=1' ); ?>
</select>

<ul><?php wp_get_archives('type=postbypost'); ?> </ul>

<?php
}
genesis();

You can also add further contents to archives page based on the requirement. For some new ideas and code snippets checkout the resources mentioned below.

Resources to built a custom Archives Page

Here are some ultimate and useful resources that helps to create a great archives page. Do check them and hope you will like them for sure.

  1. Create a WordPress Archives Template
  2. How to Create a Custom Archives Page
  3. How to Create Archive page for WordPress Blog

Genesis Archives Page Using a Plugin

Many free WordPress Plugins are available to create an archives page. But using a plugin is not good in all cases and there will be an effect on Blog Loading Speed. If you still want to use a plugin or dont want to mess up with code then here are some great plugins that helps to create an archive page.

Custom Archives Page is added to your Genesis theme and if you have any query drop a comment or else subscribe to our feeds using the form below.

This tutorial is exclusively for Genesis Framework, the best WordPress theme you will ever need. Give it a try and stay ahead of the Crowd. Period.

Genesis is the most flexible WordPress theme framework that comes with tons of options. We have been using Genesis on all of our blogs and recommending the same to you. Every bit of it is coded according to the standards. Give it a try!

Comments

  1. Ammar Ali says:

    You should also share tutorial about Thesis.. ;)

  2. lavi says:

    Hello!
    actually i have used this code but my problem is not resolved.
    my site has genesis framework and a child theme. i want to show specific category posts on my home page content area. i used the simple post query

    query_posts(‘post_status=publish&cat=33&wp_get_recent_posts()’);
    in my genesis/lib/structure/loops.php file right above the do_action( ‘genesis_before_post’ );
    but it makes no sense .
    so at last i used this grid loop but using this i am still unable to show category specefic posts on home page as it is not taking the category attribute.
    can u help me that how can i show specific category posts on my home page .

    the main problem is this : by clicking on a particular post link the post doesn’t open on a saparate page it redirects to the same page.

    can anyone help me regarding this???

  3. Sakthi Ganesh says:

    Can you please direct me ,how to display the category description and the post excerpt for the particular category in the category archive page?
    I am using Genesis with nomadic theme.
    Thanks in advance

  4. Mahesh says:

    Hi Bharath, do you know how to remove the author field from the archive page? I mean is there any shortcode for removing the author field in archives template that we can use in our child theme?

Speak Your MindComments Policy →

*

Looking for More Awesomeness?

Read previous post:
remove-comments-closed-message-thesis-theme
How to Remove Comments on this Entry Are Closed in Thesis

Simple tutorial on How to Remove Comments on this Entry Are Closed in Thesis. At WPSquare, we are writing a...

Close