On the first page of a specific category, I want WordPress to show 4 posts per page. On the following pages, however, I'd like to have 6 posts per page. I tried using a conditional query (see below), but this completely screwed up the number of posts per page...

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                 
if ($paged == 1) {                              
elseif ($paged > 1) {

This leads to 3 posts being displayed in a wrong order. There's probably a stupid mistake in there, but I can't figure it out. Echoing the $paged variable works just fine.

2 Answers 2


One way to do it is use WordPress › Custom Post Limits « WordPress Plugins. That plugin gives options for individual categories, first page and pages, archives and search results without needing custom loops in template files.

  • Thanks, this looks like it could solve my problem. However, I'd prefer a way to do this without a plugin...
    – Daniel
    Jul 10, 2012 at 12:54
  • oh what the hell, the plugin works like a charm. Thanks! :)
    – Daniel
    Jul 10, 2012 at 17:40
  • It does work well; it might be mu-plugins aware so that end users don't disable it, if that's a concern: codex.wordpress.org/Must_Use_Plugins Jul 10, 2012 at 17:43

Refer this link:


It will show the code to show different number of posts in the second pagination pages onwards.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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