Hi friends, do you want to create a custom archive page for your WordPress site? The WordPress archive page displays all your old and new posts in a single page. In this, you can add Monthly archives, Category archives, Tag archives and Author archives etc.
Today in this article I will tell you how to create Custom Archive Page in WordPress.
However, WordPress comes with a default Archives widget that you can place in the sidebar of your site. But here I will tell you how to create a custom WordPress archive page.
How to Create Custom Archive Page in WordPress
To add a custom WordPress archive to your site, first create a page template. Then save it under the name Archives.php.
<?php
/*
Template Name: Archives
*/
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<div class="entry-content">
<?php the_content(); ?>
/* Custom Archives Functions Go Below this line */
/* Custom Archives Functions Go Above this line */
</div><!-- .entry-content -->
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
After that upload it to your theme folder (wp-content >> themes >> your current theme).
Now, this Custom WordPress Archive Page will add the following things to your site.
- Search Form
- Archives By Month
- Archives By Category
How to Create Custom Archive Page in WordPress
After completing the above process, just click on Page >> Add New option and select Archives from the Template drop down in the Page Attributes section.
After completing the above process, just click on Page >> Add New option and select Archives from the Template drop down in the Page Attributes section.
You don’t need to add anything on this blank page. Now publish your page and visit your site to see it.
Read more article:
- Top 10 High CPC Adsense Niches and Keywords in 2022
- How to earn money from blogging in 2022? 10 Best Ways
- What is Google Adsense Auto Ads – How to Work, Enable?
- What is Blogging – How to Start Blogging? Guide 2022
- What is Technical SEO? Technical SEO Checklist 2022
Congratulations, you have successfully created a WordPress archive page on your site. A small request, if this article has proved to be helpful for you, do not forget to share it!