WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have WordPress set to display 5 posts per page, which is what I want. However, I'm now starting to use the new post formats (link, status, quote etc.) but I would these to not be counted towards the 5 posts per page. So how can I make the loop display the last x posts until it hits 5 standard posts?

share|improve this question
Hi. Rigging one page to stop showing after 5 normal posts is relatively easy. Rigging the pagination to divide up all the posts after 5 normal posts is difficult. Can you confirm which it is that you want? – Paul Gregory Oct 11 '11 at 18:57

As per comment trying to do this in one action will probably cause unholy pagination issues.

It might be easier to limit main query to normal posts, query posts with formats separately (depending on what you have in normal posts by date) and mix two sets together on display.

share|improve this answer
This is essentially what I was going to suggest: exclude the post-format Posts from the Primary Loop, so that they are excluded from Loop output and in the pagination. Then, query the post-format Posts using a secondary loop, and output them however appropriate. – Chip Bennett Oct 11 '11 at 22:28
That would be perfect yes. I understand the exclude part for the main loop with the standard posts but I'm not sure how to set up the second loop and then mix it together to be displayed in chronological order. Any pointers would be most welcome. – Jos Oct 12 '11 at 8:28
@Jos basic idea would be to retrieve two sets of posts as arrays, put those array together (sorted by date) and loop through resulting set. That is mostly a lot of PHP rather than WP functionality. – Rarst Oct 12 '11 at 8:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.