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

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.

share|improve this question
up vote 0 down vote accepted

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.

share|improve this answer
Thanks, this looks like it could solve my problem. However, I'd prefer a way to do this without a plugin... – Daniel Jul 10 '12 at 12:54
oh what the hell, the plugin works like a charm. Thanks! :) – Daniel Jul 10 '12 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 – markratledge Jul 10 '12 at 17:43

Refer this link:


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

share|improve this answer
An answer should be more than just a link to an external site. Please add a solution. – toscho Nov 3 '12 at 14:09

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.