Archive page should not return 404 when requested page is larger than max page
|Reported by:||kayue||Owned by:|
Right now Wordpress return 404 when requested page number is larger than max page, and this could be a problem when people changed posts_per_page on query_posts.
For example, assuming the default post per page is 10 (in Reading Settings), and there are 15 posts in archive page (total 2 pages).
In archive.php, if I change the post_per_page to 5, there will be totally 3 pages. With the current implementation, the third page will return 404 page not found, because with the default setting, this page shouldn't exist.
I suggest Wordpress should still load archive.php even requested page is larger than max page, and use have_posts() to determine what to display (similar to loop-home.php)
Related discussions in forum: