How to customize your blog archives

In the site editor, we're going to go to Templates and All Archives. You'll see in the description that this displays any archive, including posts by a single author, category, tag, taxonomy, all of that. So we're going to edit this template and it works very similarly to the blog template, except that there's no sidebar. This is a full-width template for displaying a grid of posts. It's a little bit easier to navigate in terms of trying to find a specific post.  

Where the blog page is for people who are browsing the latest posts in reverse chronological order, the archive page is for people who are searching for specific content. So they want to see all the posts in your style category or your beauty category or so on. And so a grid is just a nicer way of making that easy to navigate and find a good overview of all the posts. 

You'll see on this template that there's actually only four posts showing and the tricky thing about this template is it's going to inherit from your blog home settings. So when you go into blog home and it says posts per page, that's going to apply to all blog pages. You'll see it says set the default number of posts to display on blog pages including categories and tags. Some templates may override this setting. The problem is if we we override this template there's no way of really doing that in a way that works. So, if you go into query loop you'll see right now it says inherit query from template. That's how it knows to display content from a particular category. 

What we want to do is instead on the blog home page we're going to set the posts per page to what we want it to be on the category page. For our category if we're displaying three columns then we're going to want a multiple of three like six, nine, twelve, so forth. So, I'm going to change this to nine and I'm going to go ahead and save that. And if you go back to the archives page you'll see now it shows nine posts. 

Similarly to the blog page you can swap out that query loop for different layouts. So, if you wanted to do the four column layout you could choose the four column one, save of that and then you'd have to change your blog home post per page accordingly. That we'd want to make it twelve. So, once we make that twelve you can go back to the archive page and see that now we've got a full grid of twelve posts. 

Now the problem that has come up is if you go back to your blog page you'll see you're scrolling down to twelve posts and you might not want that. If your blog page matches, great, no problem, but in this particular case we want a different layout and we don't want as many posts here. So, what we're going to do is click on that query loop, turn off the inherit query from template, and see how it says order by newest to oldest, post type post. It doesn't have any other parameters and so it's always going to show the latest post.