There are 5 templates for each category, archive and author. These templates are the same for all of them, they only differ what is in the header.
- The category templates remove the usual “Category:” before the category name in the heading
- The author templates show the profile picture of Gravatar
- The archive templates show the usual archive with the heading “Month: March 2020”
HTML can be used in all templates in the category description or the authors bio.
category.php, archive.php and author.php
These are the default templates. The posts are displayed in horizontal cards which flip to vertical cards on smaller screens. If a sidebar is active, it will be shown on the right. If no sidebar is active, the posts are displayed across the entire width of the container.
The same as default, but the sidebar is on the left.
Shows the posts in vertical cards in a grid and the sidebar on the right. If no sidebar is active, there will be white space.
All cards are the same height, no matter whether there is a featured image or not, long or short excerpt, long or short heading. The Read more is always at the bottom of the card. The height of all cards determines this one with the most content. So if the cards sometimes have very little and sometimes a lot of content, there is a lot of white space. This can look very tidy if all posts have approximately the same length of excerpts and all have a picture or none.
The same as -equal-height-sidebar-right.php, but without sidebar. The cards are displayed in a 3 (desktop), 2 (tablet), 1 (mobile) grid.
This represents the posts in a Pinterest-style layout. Each card only has the height of how much content it contains. No sidebar is displayed.
There are several ways to use these templates, the best thing is to take a look at the WordPress Template Hierarchy.
WordPress first searches for a category-(your-category-slug).php. If that file doesn’t exist, it takes category.php. And if that file doesn’t exist too, then it takes archive.php. The archive.php is the last and most important instance.
You don’t need it that complicated, one is enough for all of them. Keep only archive.php and delete all other archive-, category, and author.php.
As an example you want all posts to be displayed in category-masonry style. Then all you have to do is rename category-masonry.php into category.php. Archives and author too, of course.
If you want to display the author as masonry, the category as equal height and the archive with sidebar left, you only have to rename the respective file into category.php, author.php and archiv.php.
For example, you use the same template everywhere, but want to display one category differently from the others.
You have a category “cats” and want to use it in masonry style, while the category “dogs” uses the default layout. This case, just rename category-masonry.php into category-cats.php.
For author the same. Simple rename the respective author-().php into author-name.php. For example, Author name “John Doe”, rename archive-equal-height.php into author-john-doe.php and his author page will shown different than the other authors.