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 the following code in my search results page to split up posts per category.

When I go to the 2nd page of pagination, the results are exactly the same as the first.

I'm assuming $paged has to be inserted but i'm not sure where.

Any help would be appreciated

Code: http://wordpress.pastebin.com/qWnaLxgd

share|improve this question
Voting to close as duplicate for the many similar questions already asked regarding loops and pagination, please see: wordpress.stackexchange.com/search?q=custom+loop+pagination – t31os Feb 25 '11 at 18:52
possible duplicate of Pagination not working with custom loop – t31os Feb 25 '11 at 18:55
up vote 0 down vote accepted

In line 51:


change to this:

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
share|improve this answer
thank you, worked perfectly! – Chad Feb 26 '11 at 0:10

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.