wp query – WordPress Show 4 posts from 4 specific categories in one slider

I am trying to show 4 posts from 4 different categories (one from each cat) in a row but cannot show any 2 posts from any category at once. There are 5 posts in each category, so I need to clearly display them one by one.

The next row will again have 4 terms except for the first 4 positions. To clarify

Line 1 shows: Cat 1 -> Post 1, Cat 2 -> Post 1, Cat 3 -> Post 1, Cat 4 -> Post 1

Line 2 shows: Cat 1 -> Post 2, Cat 2 -> Post 2, Cat 3 -> Post 2, Cat 4 -> Post 2

And so on.

How can I query posts like this?

Leave a Comment