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

1 Answer

up vote 0 down vote accepted

In line 51:

query_posts("s='$s'&cat=177");

change to this:

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts("s='$s'&cat=177&paged=$paged");
share|improve this answer
    
thank you, worked perfectly! –  Chad Feb 26 '11 at 0:10
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.