I’m trying to control the number of posts listed by the archive.php template using the following query_posts function before the loop:
<?php query_posts('posts_per_page=1'); ?>
<?php <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
This query_posts setup doesn’t work in archive.php the same way it does for index.php: it will in fact display one post, but clicking on previous posts points me to the 404 error template.
I’ve looked elsewhere on the web and on StackOverflow for solutions, but have not been able to find a anything that works. I’ve also tried the following without success:
<?php global $query_string; query_posts($query_string . '&posts_per_page=1&paged=' . $paged); ?>
and
<?php global $query_string; query_posts($query_string . '&posts_per_page=1'); ?>
1) Login as the admin in WordPress.
2)Go to the Settings tab.
3)Go to the Reading tab.
4)Change the Blog pages show at most from the default 10 to any number *less than 10.
For example, 5.
5)Save the changes.
View the blog.
edit the number to less than 10, hope it helps you out. It fixed mine.
while debugging i found out that default posts per page option should be less than any custom posts_per_page in query_posts function. That’s all. Weird, but that’s the fact.
There are some possible reasons in my case it was a problem with permalinks and .htacces rules
Read this post may help
http://www.wordimpressed.com/wordpress/solve-wordpress-custom-post-type-404-error-issues/
I use this plugin for querystring correction
http://wordpress.org/extend/plugins/category-pagination-fix/faq/