How can i call an article from each category and still paginate properly?

My recommendation would be to use a separate query for each column – getting 1 post per category – and pass the global $paged variable into each. This should exhibit the behavior you described in your question (at least it does on my site).

My setup

I have a top section that displays the 5 most recent posts from the “featured” category if you’re on page 1 only. Then I have a sidebar that displays the first page of posts from each of 3 primary categories, each using their own query with posts_per_page=1. Then I have the main section that displays all posts normally with 5 posts on each page.

The first page returns my featured posts in a slider, the regular post section below it, and the first post from my three core categories in the sidebar. Page 2 hides the “featured” slider, returns the next 5 posts overall in the main section and the second post in each of my core categories. Page 3 and beyond do the same thing.

So what you’ll need is not one loop over 3 categories, but 3 loops each over a single category and each using the global $paged variable.

Leave a Comment