This tutorial shows the featured image and post title from the most recent posts in every category on one page like this:
Note: You want to make sure your featured images are all the same size otherwise regenerate thumbnails, or remove the entry class from the code which prints the white background.
You can also exclude, include and customise what posts and categories you want displayed simply by changing the settings in the code.
Code Installation
- Using a code editor, create a new file in your child themes root directory named custom.php and add the code to the file.
- Select the Template from the drop down menu under the Page Attributes met a box on your Edit Page screen.
Here’s the code:
Hi Brad,
How would I get this template to work for 1 category only? I have 4 categories, so ideally I’d like to have 4 templates.
Thanks
Tony
You could set the category paremeter like this:
Swap out the $value for the category slug or category id.
Or you could simply use column classes to display your category archives in columns.
You can also use the template hierarchy and create category files for each using the slug like category-news.php where news is the name of the category.