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’)
- Changing pagination list class
- Pagination resolving to first page only
- Pagination of RSS2 feed
- Modifying WP_LIST_AUTHOR Functions to output all users in a grid (and Paginate)
- Problem: ( kriesi ) pagination doesn’t work in homepage [duplicate]
- Custom loop pagination issue ( pagination not showing up )
- How to ignore or disable nextpage tag?
- WordPress Pagination not displaying posts after certain page
- get_query_var(‘paged’) giving same result
- Show content only on front page?
- Getting 404 on taxonomy page
- Why am I getting a 404 on anything past page 1 of my query?
- Getting pagination for second loop to work on single.php
- Pagination difficulty using custom query in genesis-based custom theme
- Pagination on custom query
- 5 posts per page from single category, paginated
- WordPress custom URLs for pagination pages
- Home page not obeying post per page setting on the first page only
- How to add pagination to a single post
- Clean install – Changing permalinks in twentyeleven give 404
- Setting posts per page in query_posts
- WordPress rewrite rules for pagination on search page
- Styling the_posts_pagination With Font Awesome
- Pagination on 2nd loop
- How can I show a multipage post as a single, wrapped post?
- Why does pagination go to a blank page when navigating through home.php?
- Pagination with $_POST and $_SESSION
- wordpress is converting ?page=2 into /2
- Template hierarchy about pagination after front-page.php
- Add pagination to my custom loop [duplicate]
- Pagination with WordPress default gallery?
- How do i improve my custom pagination?
- Post Pagination Customization (wp_link_pages) Editing Navigation
- How to return a 404 when custom query matches nothing?
- Default pagination is broken when use ‘static page’ as ‘front page’
- Paginate results from data fetched through array
- make a pagination that show posts by date
- Adding pagination on template page wordpress
- Pagination on custom post type not working if permalinks set to rewrite url
- Theme Option not Working Inside a Function
- search with pagination not working as expected
- Cannot go back to the first paginated page using pagination links
- Remember form field values with page navigation
- Can’t get pagination to work for sticky posts only
- How do you choose to display specific posts/pages by parent url
- Automatically adding a link to the next page link before ” tag in posts?
- Hide content after going to page 2 of archive, show content when back at first page
- Add pagination to this following template
- split wordpress loop into columns of categories and associated posts
- Reciving Error 404 blog/page/2/
- How Change URL in Pagination pagebreak no plugins wordpress?
- How is the Page Splitting implemented in the theme?
- Why the page number does not appear in splitting post?
- Use of rewind_posts() cause pagination to break
- Pagination not working in custom post type but perfectly in posts
- Paginate Images To Similate Map Drill-Down
- Custom pagination with URL parameters
- how to add pagination to a popular post custom page?
- Add pagination – syntax error when copy/pasting
- Remove “Page” from Category archive
- Query Post interferes with Pagination
- Problem with Paging 404
- Pagination not working past page 3 on archive page of category
- Using the_posts_pagination with offset adds extra empty page
- Search, pagination, the last pages leads to 404 page
- Pagination is not working in custom page template
- How to pass posts_per_page and paged params query vars to custom taxonomy archive urls?
- How to implement pagination eg. newer – 3 – 4 – 5 – 6 – 7 – older
- 404 Pagination issue for only one category
- Adding pagination to query for custom page
- Main page paginate_links issue
- Plugin to show pagemap beneath certain page and next/previous page beneath certain page?
- Pagination in custom loop for custom post type throwing 404 error
- Removing template part when not on homepage if / else
- Paginate template name
- pagination does not work with query_posts. Help! [duplicate]
- WordPress custom post type post and category links 404
- How to reduce the number of pages in pagination
- foreach pagination
- Pagination only working on index page not on a template page