Using query_posts is generally not recommended. Looking at the Codex, it specifically states:
Note: This function isn’t meant to be used by plugins or themes. As
explained later, there are better, more performant options to alter
the main query. query_posts() is overly simplistic and problematic way
to modify main query of a page by replacing it with new instance of
the query. It is inefficient (re-runs SQL queries) and will outright
fail in some circumstances (especially often when dealing with posts
pagination). Any modern WP code should use more reliable methods, like
making use of pre_get_posts hook, for this purpose.
Note the “especially often when dealing with posts pagination” part.
I would try re-writing your code with one of the other suggested methods and see if that changes the behavior.
Related Posts:
- WordPress /page/2 404 pagination problem – what to do?
- Custom post type archive 404’s with paginate_links
- Non existing blog pages are not redirected to 404
- category/category_name pagination 404 error
- Pagination gives 404 in template
- Pagination (page/2/) displaying 404 on archive pages
- 404 not found error on pagination
- Pagination on home page not working
- WordPress triggers 404 on page 2 for custom search query
- Pagination 404s on custom query
- Pagination, query more pages at once
- WP Page Navi. 404 error when using posts per page parameter [duplicate]
- Error 404 on pagination on homepage
- Page not found yet the posts are listed?
- remove rel=next on category page (if
- Changing post per page causing 404 for pagination. Need a redirect htaccess rule
- Pagination 404 Not Found child page
- paged query leads to 404? [duplicate]
- Please Help me with Archive 404 Pagination
- How to remove post duplicate when using query_posts(‘offset=1’)
- Is it possible to paginate posts correctly that are random ordered?
- How to determine if I’m on the first page of pagination?
- Changing pagination list class
- How to determine if theres a next page
- Paged posts – how to use numbers and next/previous links?
- Why do you need an unlikely integer in paginating?
- How to display pagination links for WP_User_Query?
- How to show a single post on the front page but have normal paging?
- Custom post type pagination 404 fix?
- How to add CSS Class to previous_post_link or get previous/next post link URL
- Pagination resolving to first page only
- how to get pagination link url?
- add_rewrite_rule – working fine but broken for pagination
- How to get the number of Pages in a single Post Pagination?
- Aggregate comments, with pagination
- post pagination names, not numbers
- How to fix pagination after rewriting url? ie. www.site.com/players/type/pro/page/3/
- Display “Page 3 of 5” for a paginated post
- Custom Taxonomy not working with posts_per_page in new WP_query (pagination problem)
- Pagination throws 404 error on custom taxonomy archive pages
- get_query_var(‘paged’) always returns empty
- Implementing a general Table of Content across single paginated post pages
- Paginate links with “ugly” and “pretty” permalinks?
- Pagination of RSS2 feed
- Strange paginate_links behavior. First page link is always whatever page I’m on, all other links are correct
- Custom WP_Comment_Query with pagination and orderby?
- Get the number of posts from the current page results
- Pagination: How do I always show ‘previous’?
- Next/Previous Links in same category
- How To create ajaxed wp-pagenavi?
- Single Page View for Paginated Posts
- How can I see all of a post’s comments on a single page as a reader, if pagination is enabled?
- Using paginate_links() to generate “1, 2, 3 … 10, 20, 30, 40… 55” paginations
- Change class=”page-numbers” in pagination
- Check if on last page of paginated post using wp_link_pages
- Pagination shows 404 after a certain number of pages
- Varying the number of posts per page from the first one
- Pagination on archive.php page
- Using pagination with get_posts on page type
- List posts based on first letter of posts
- Pagination for sub-pages
- Modifying WP_LIST_AUTHOR Functions to output all users in a grid (and Paginate)
- How to get post pagination like this
- How to paginate a list of tags
- Pagination Not Displaying on Custom Term Archive
- Having trouble generating pagination links on custom query
- posts_per_page & pagination conflict
- How to implement pagination eg. newer – 3 – 4 – 5 – 6 – 7 – older
- Pagination throws 404
- How do I sort multiples pages?
- How to pass posts_per_page and paged params query vars to custom taxonomy archive urls?
- 404 on category.php pagination
- Problem: ( kriesi ) pagination doesn’t work in homepage [duplicate]
- Custom loop pagination issue ( pagination not showing up )
- WordPress pagination on custom script
- Combining WordPress pagination functions for archives and search results
- Pagination is not working wp_query custom fields values
- Broken pagination
- Passing custom args in paginate_links
- Limit number of pages in pagination
- wordpress Static Page pagination
- Pagination causes error 404 when used with front-page.php
- Static front page with recent posts pagination
- query_posts and pagination, still stuck after much research
- How to ignore or disable nextpage tag?
- Paginate tags page
- pagenavigation not showing the next page just linking back to the main page [closed]
- how could I get the pagination as I want to when query posts using get_posts function
- Category pagination shows same posts
- How to display next and prev pagination links with WP_User_Query?
- Custom taxonomy list and sortby letter pagination problem
- Paginate a list of users?
- Move pagination numbers above plug-ins
- Custom Page Template for “Older Posts” Pages
- Allow Users to Choose Pagination or Next/Previous (Combine)
- WordPress Pagination not displaying posts after certain page
- wp_link_page – wrap current page element
- How to create pagination on archive.php template
- Paginate get related post by author function
- Pagination that includes “view all on one page”