https://visualcomposer.com/blog/wordpress-archive-page-and-post-grid/
WordPress Archive Page and Post Grid Explained
FacebookTwitterSubscribePinterestLinkedin
It’s 9:00 am. You’re about to finish your first coffee cup while scrolling an online magazine or news portal. What do you see in those WordPress websites? Well, these posts are organized in the grid layout. Or you navigate through the archive page. Lists of WordPress posts filtered in a specific way (by category, tag, etc.) are called archive pages.
In this post, I am going to cover the following:
- What’s an archive page;
- How to create an archive page in WordPress;
- Post grid layout explained;
- How to display WordPress posts in a grid layout.
To give you some icing on the cake, I will provide a list of the best archive page and grid plugins for WordPress.
Ready? Go! ????
What Is A WordPress Archive Page
The main purpose of an archive page is to easily navigate your visitor through your previously published content.
What exactly a WordPress archive page displays? Archive pages are generated to organize a list of posts under a specific post type, category, or tag. For example, a blog is a great illustration of the WordPress archive page.
Archives are also available for the custom post type. WordPress custom post type is a content type that allows you to add your types of data (e.g. custom fields and categories). You can create one with a plugin or by adding a custom PHP code into your theme.
If your installed theme or plugin supports custom post types (e.g. WooCommerce), WordPress will automatically create archive pages for your custom post type as well.
The archive page has multiple benefits. First of all, it can radically improve SEO and help your audience to find the desired content. Secondly, the archive page is a practical way to display all published pages and different post types. It will ease the navigation process. How? By listing your old content based on a date, category, tags and more.
WordPress creates archive pages automatically. So, you don't need to waste your time making it from scratch. Yet, customization of your archive page can boost your traffic. And better the appearance and the performance of your site. If you want to create a custom archive page, you have several options available. There are a coding and non-coding option. The last one can be using a plugin such as Toolset, which lets you build fully custom archive pages.
How to Create an Archive Page in WordPress
Now, you are probably asking the question about how to create an archive page in WordPress? I am going to cover different approaches on how to make your archive page within a few minutes and clicks. You can select and apply the one you like the most.
Theme-Defined Archive Page
Almost every WordPress theme has an integrated file called archive.php. It is used to display and define the archive-type page look. WordPress and theme developers use this file to show the archive’s page input on the front-end.
Even though the file is integrated you can still customize the appearance and style it using CSS. Display custom fields in your theme-defined archive page by adding custom PHP code to the archive.php file.
Archive Page Plugins
Plugins make everything easier because most of them utilize shortcodes. Archive page plugins are an alternative solution to the archive page template creation. The plugin is a user-friendly and code-free way to create an archive page.
There are a few archive page plugins for WordPress. For example, Archive Control and Annual Archive.
But, the most efficient and handy way is to use a page or website builder. Why? Still no coding, fast design process and a great number of powerful features to create a beautiful archive page.
Custom Archive Page
You can also design an archive page for a custom content types. The first option is to create a new PHP template and upload it in your WordPress themes folder. If you want to change or specify what and how you want your content to be displayed.
The second solution is to create a page and then set this as an archive page. Of course, you can customize it after as well.
Thus you need some coding skills to do so, there are many resources filled with explicit tutorials and how-to guides. Consider GitHub or one of the WordPress tutorial sites.
To break it all down, you can follow the complete step-by-step guide on how to create a custom archive page below.
How to Create a Custom Archive Page
You can create an archive.php template for the monthly, author, tag or custom post type archive page. Or you can make a custom archive page. It will be a one-page template to display all archives. Plus, you can assign it to any page to create an archive page.
How to Create a Custom Archive Page in WordPress
If you want to set a page as an archive page you need to create a template first. To do so, create a PHP file with the help of the text editor. We will name it a customtemplate.php. Add the following code at the top:
<?php
/* Template Name: Custom Template */
?>
After you have uploaded the customtemplate.php file in your theme folder, copy and paste the code from the archive.php file in it and make changes if necessary. What we want to achieve is that your archive page template design will be the same as the rest of your website. This is how your file can look like to match the design of your website:
<?php
/* Template Name: Custom Template */
get_header();
?>
<main id="main" class="content-wrapper">
<header class="page-header">
<?php
the_archive_title( '
', '
' );?>
<?php
// Start the Loop.
while ( have_posts() ) :
// You can list your posts here
the_post();
?>