Home Tutorials How to Create An Archives Page

How to Create An Archives Page

Author

Date

Updated on

Category

In another effort to de-clutter the sidebar and begin your initiation for The Organization for the Organized, here’s how to create an archives page for archive links listing by categories and months. First of all, check out the Wpdesigner’s archives page to see what you’ll be adding to your blog.

Second, most free WordPress themes already have an extra page template for an archives page. Look in your theme’s folder for an unused PHP template file. Usually, theme authors name this template archives.php, which is different from your default archive template, archive.php (without the “s”).

Third, you need to know that this tutorial is not the end-all tutorial for creating a custom archives links listing page. The structure of each theme is not always exactly the same as the next theme’s structure. All I can show you is the basics and how I did it.

The Steps:

1. Create a new file and name it archives.php

2. At the top of that file, type:

<?php
/*
Template Name: Archives Page
*/
?>

Without those lines above, you won’t be able to use your new archives template file so be sure that you don’t leave that out.

3. Add the loop, title, category listing, and month listing:

<?php while(have_posts()) : the_post(); ?>

<h2><?php the_title(); ?></h2>

<ul><?php wp_list_cats(’sort_column=name&optioncount=1′) ?></ul>

<ul><?php wp_get_archives(’type=monthly&show_post_count=1′) ?></ul>

<?php endwhile; ?>

4. Tweak the codes above to make it fit in with your current theme. Here’s where different theme structures come into play. I can’t give you my archives template because it might not work with your theme’s structure.

5. Upload it to your theme’s folder.

6. Create a new page and select your newly upload Archives page template for that page.

 

write-page-archives-templat

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Recent posts

How to Optimize Images for Your Blog Posts

Developing a WordPress site is only one half of a complex equation. To get the site going and attract traffic, you have to fill...

10 Ways To Speed Up Post-Building Process With WordPress Gutenberg Themes

There’s no need to explain why I decided to start with Gutenberg-supporting products. All in all, Gutenberg is a well-known and long-awaited product. It is more...

HostPapa Linux Hosting: Reliable, robust and fast

As a small business owner, it can be challenging to find the right hosting provider for your website. HostPapa distinguishes itself from other web...

Are You Making These Costly Mistakes When Outsourcing?

In today’s world, it is almost impossible to find a small business where everything about the business process is done in-house. For most small...

Flat Design for Your WordPress Site: What Is It + 4 WordPress Flat Design Themes

Web designers in the past mostly used 3D styles for buttons that made the button seem more realistic. That all changed when flat design...

Recent comments