Generally, every website or personal blog has a specific sidebar area used to display previous articles so that readers can know clearly what you have written a few days before and check out your content easily. However, this section can only display a small fraction of all your outputs, let’s say 8 posts or 10 posts, if you have created a lot of articles for the website. In this case, how can readers find your old content?
To deal with this situation, a WordPress archive page needs to come into play. This is a single page containing the links directed to all your posts, allowing visitors to browse your website through a specific gateway.
In the following, we have introduced a detailed tutorial concerning about how to create such a powerful webpage. It is not a difficult task. Even beginners can finish it after checking out the guidance.
Create an Archive Page
First of all, you need to create a separate webpage from your WordPress admin panel, and then assign it as an archive page.
Simply go for the left sidebar of the admin panel and find the Pages category. Click the Add New button to create a new page for archive.
You can name this page whatever you like, but we still recommend you giving a suitable title like Archive Page. After all, a standard name can make it easy for you to manage, change, and customize the webpage.
Create an Archive Template
Now, you need a simple template for your archive page. The default theme of WordPress version 3.0 and beyond has already included this template. If you fail to find it in the directory of your theme, you have to create one manually.
To do this, you can open up a new file that needs to be named as archives.php, and upload it into your WordPress folder. Then, add the lines of code listed in the following and save the file. In order to match the design of your current theme, you’d better adapt the HTML structure and copy the code of your page.php file into this file.
Put the Template into Archive Page
Now, you need to go back to your WordPress dashboard. In your newly-built archive page, there is an option called Page Attributes that has been located at the right of the whole screen. After finding the right place, click the dropdown menu and choose Archive as the template. Then, simply save the setting and publish the page.
If you want to display your posts in a different way but not only the general monthly listing, you can make use of the wp_get_archives template tag. See the codes needed in the following.
Display archives alphabetically
Display archives yearly
Display archives monthly
Display archives daily
In case there are a lot of authors writing posts for your site, you can also add an author archive by adding the following line of code into the archives.php file.
Of course, you can also use some user-friendly WordPress plugins to do this task for you, such as Clean My Archives, Compact Archives, and Archives. Simply download and install one of them in your site, and then things can be down within minutes after successful activation.