How to get latest posts from each category in regular order

let’s say I have a main query and it displays posts from Movies and Music categories. I want the query to show always 5 latest posts from Movies and 5 latest posts from Music category. When I create a new post in Movies category the query will show 6 posts From Movies and 4 posts from Music category. But I need a way to show always 5 latest posts from each categories on homepage.

In other words, I still want the regular query where posts are ordered by date and not categorized but want to limit the number of posts per category displayed on homepage. I found some solutions to display latest post/posts from each categories but all those solutions categorizes posts. I still want the regular wp query.

Read More

Here are two solutions: http://eisabainyo.net/weblog/2010/03/10/display-5-latest-posts-in-each-category-in-wordpress/

First post of each category

As you can see posts are categorized and are not in regular order. When there is a new post it will not be at the top and will go under its own category. I really googled for hours, tried many solutions but none of them does what I want.

UPDATE: This question was marked as duplicate however I tried the mentioned answer and realized it’s not what I’m looking for. I already found similar solutions but they all categorize posts. e.g.

First Movie Post – Second Movie Post – Third Movie Post

(then) First Mucis Post – Second Mucis Post – Third Mucis Post

Posts should be displayed as if it’s a regular wp query where posts are displayed by date no matter which category they belong. But each category should be limited by 5 posts. So the mentioned answer is close but not exactly what I’m looking for. Sorry for my terrible English.

Related posts

Leave a Reply