Using query_posts() on any subcategories the attached posts_per_page attribute gets lost
|Reported by:||voetzi||Owned by:|
I have a subcategory containing 9 posts. If this category is showed with the archive.php temlate, i want it to show only one post per page. The default posts per page value in the WP settings is 5. So i build a query this way:
query_posts( $query_string . '&posts_per_page=1' );
This works fine for:
Remember 9 posts in that subcategory and a default posts per page value of 5. If I point my browser to:
I get a "not found page" (not a 404) with the search form on it. So i added this code to the searchform.php:
<?php echo"Query:". urldecode($query_string;)?>
The result is: paged=3&category_name=cat/subcat The posts_per_page is missing.
After figured out this, I changed the posts per page in the WP settings to 1 and it worked, as it should. Changing it to 3 it works till page 3 and i have the same effect on page 4.
This is why it seems to me, that the posts_per_page attributes gets lost during processing and then is overwritten with the default value.