Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.