How do I tell WordPress to change the number of posts to display depending on the type of page being shown? For example, all Search results will show 10 posts at a time while Archives will show 20 posts at a time, etc.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
what you have to do is to deal with the query_post() function.
See this codex page : http://codex.wordpress.org/Function_Reference/query_posts
You will then have to modify your archive.php and search.php files (depending on your theme) to call this function right before the loop.
All is described in a pretty simple example here
Hope this will help 😉