The archive template is a pretty important part of your WordPress website.
It’s how people can view your posts and other custom post types based on category, tag, date and author.
And now with site editing, you’re able to completely customize your archive templates right from the dashboard. There’s no need to have to worry about digging into the archive.php file (or other archive template files) or fiddle with adding code to your functions.php file.
So let’s dive into how you can edit your archive template and even create new archive templates through the side editor.
What is the Archive Template?
So first things first: what exactly is the archive template in WordPress?
Well to put it simply, the archive template is the template that shows posts from a specific category, year, month, day, tag, author and custom taxonomy. Essentially, this is how you’re able to standardize how those pages look on your website with just one template or a couple of templates.
In classic themes, these were managed by PHP files and templates by developers. If you ever looked into the files of your theme, you might have seen files like archive.php or category.php. Those are the archive templates.
But with the introduction of the site editor, you now have the option to manage your archive templates and even create your own.
So you can make a specific category’s archive page look different from other categories. Or you can customize how the author archive pages look to truly make it an author page.
Like a lot of things with the site editor, the sky’s the limit when it comes to your archive pages.
Possible Archive Templates
There are quite a number of archive templates that WordPress uses. So let’s briefly go through them all so you know which one to use if you’re creating or customizing the archive pages on your website.
- Base Archive – This is the default archive template that will be used for all archive pages (category, author, etc.) if there isn’t an overwriting template in your theme. We’ll talk about template hierarchy in the next section.
- Date Archives – This template controls the year, month and day archive pages.
- Category Archives – This template controls the archive pages for each category used on your website. You can create a category template for a specific category as well.
- Tags Archives – This template controls the archive pages for each tag used on your website. You can create a tag template for a specific tag as well.
- Custom Taxonomy Archives – This template controls the archive pages for each custom taxonomy used on your website. You can create a custom taxonomy template for a specific custom taxonomy as well.
- Author Archives – This template controls the archive pages for each author or user who publishes a post on your website. You can create a author template for a specific user as well.
Template Hierarchy
So as you can already tell, there are many different types of archive templates that WordPress can use. And sometimes they overlap.
So how does WordPress know which archive template to use when you’re loading a category, tag or other archive page?
Well, WordPress has a template hierarchy when it’s looking for what template to use to display a page. Normally this was something that only developers had to worry about. But with templates being something a site owner can create, it’s something you’ll need to know about.
The good news is that it’s pretty easy for you with the site editor. If you want a specific category or specific author to have a template that’s different from other categories or authors, you can specify which category or author the template is for when creating it in the site editor.
And if you really want to dive into template hierarchy in WordPress, check out the article in the WordPress handbook.
Editing Your Archive Template
Editing an archive template is pretty easy.
To edit the template, go to the site editor and select “Templates”. Then pick the template you want to edit.
From here you can make any change you want to the template. For example, you might want to add in the archive term description so that there’s description text showing for your category pages. Or you can change how the posts look in the query. Maybe you want to change it from a list to a grid.
When you’re satisfied with your changes, hit the “Save” button to make your changes live on your website.
Creating a New Archive Template
Creating a brand new archive template, like a category page, features a few more steps, but it’s pretty straightforward.
To add a new template, go to the site editor and select “Templates”. Then hit the plus icon to add a new template.
Next, select the type of template you want to create. Then select whether this is for all of this type or for something specific.
Depending on your theme, you might see a modal with archive patterns you can choose to add to the template. But you can choose to start with a blank slate.
If you do start with a blank slate, first make sure to add in the header and footer template parts. You can do this by adding the template part block and then selecting either a header or footer.
Then you can add in the main content for the template. You can use the archive title, archive description, query loop block and other blocks to create your template. Just make sure that for the query you have the inherit query option selected.
But from then on, what you do next is completely up to you!
And when you’re ready, hit the “publish” button to make the new archive template live on your site.
Upgrade Your Archive Templates with the Crosswinds Framework
Want to take your archive templates to the next level? Then check out the Crosswinds Framework today.
Each Crosswinds Framework comes with options to make your archive pages look how you want them to look. From grid or list options for query patterns to changeable archive headers, you’ll have no problem getting your category, author and other archive templates looking just the way you want quickly.
So give the Crosswinds Framework a look today!
Tags:
Leave a Reply