using posts_per_page in search form not working
-
Greeting all,
A client wants to limit the number or items returned for a search result page to 5 items.
I’ve looked through the classes.php code and see the use of ‘posts_per_page’. So I’ve added a hidden form field of this name to my search form. Set the value to 5. When I search I still get the default of 10. I’ve tried to trace through the code and cannot determin what I’m doing wrong.
My WP is 2.0.3. Here is my form code:
<form method=”get” id=”searchform” action=”<?php bloginfo(‘home’); ?>/”><input type=”text” class=”textbox” name=”s” id=”s” value=”<?php echo wp_specialchars($s, 1); ?>” />
<input type=”hidden” class=”textbox” name=”posts_per_page” id=”posts_per_page” value=”5″ />
<input type=”image” alt=”go” class=”imgbutton” name=”imageField” src=”<?php bloginfo(‘template_url’); ?>/images/gosearchbutton.jpg” /></form>
- The topic ‘using posts_per_page in search form not working’ is closed to new replies.