Display the Most Recent Post in Each Category
read more
Categories

Display the Most Recent Post in Each Category


By default, your main WordPress blog page displays your most recent posts in descending date order. But if you’re using categories on your site and your readers will want to see what’s new in each category, you might want your blog page to look different.

The first step is to get the theme set up. I’m going to create a child theme of the Twenty Fourteen theme, with just two files: style.css and index.php.

As I want my main blog page to display the latest post in each category, I’m going to create a new index.php file in my child theme.