query_posts + showposts + permalinks = 404
|Reported by:||wp_guy||Owned by:|
|Component:||General||Keywords:||query_posts, showposts, posts_per_page, permalink, 404|
So, apparently when doing something like query_posts($query_string.'showposts=2'); in a category.php file for example. Everything seems to work fine, but the paging doesn't, I get 404 errors on the 3rd page.
Here is how the blog is setup:
- 'Blog pages show at most' is set to 5 in the settings
- category.php has a query_posts($query_string.'showposts=2');
- the category I'm browsing contains 7 posts.
- permalinks are set to 'month and name'
Here is what I do:
- myblog.com/category/mycategory works fine, shows 2 posts
- myblog.com/category/mycategory/page/2 works fine too, shows the next 2 posts
- myblog.com/category/mycategory/page/3 returns a 404 error.
The above works just fine if I use the default permalink structure (query string).
I've seen this error in 2.6.3 and 2.7, haven't tried on earlier versions