Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

i have a query php query_posts( array ( 'category_name' => 'faq', 'posts_per_page' => 2 ) )

i wanted to add next and previous pages for this but not able to

thank you in advance

share|improve this question

closed as not constructive by toscho Jul 22 '12 at 23:07

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.

1 Answer

Use this code

 <?php previous_post_link('%link', 'PREVIOUS', TRUE); ?>     
 <?php next_post_link('%link', 'NEXT', TRUE); ?>

Remember to set it into the loop

share|improve this answer
i have tried that also instead its directing to next post not page – user10345 Nov 18 '11 at 5:53
and what's supposed to be in the other page? or actually, what are you trying to retrieve? – andrewkthx Nov 18 '11 at 5:55
how to set in loop??? – user10345 Nov 18 '11 at 5:56
i have 6 post ok.and i have put them in faq category and i wanted to show 2 faq per page i have a template take the post as above query now i wanted to put pagination to it – user10345 Nov 18 '11 at 5:57
you have to use some ajax code... if you are calling categories into page you cannot just set a next and prev of that specific category... – andrewkthx Nov 18 '11 at 6:03

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