twentyeleven_content_nav()
uses the main query object, $wp_query
. You’ll need to use the $wp_query
variable, rather than $unfiltered_query
, then wp_reset_query()
to restore the original $wp_query
(which it’ll find in $wp_the_query
, something you should probably avoid touching directly).
As long as you’re careful to restore the original query, you’re in good shape.
I would submit a patch to core that allows twentyeleven_content_nav()
to optionally take a query object which it can use for its calculations.
Related Posts:
- Get the number of posts from the current page results
- Why does pagination always break when used on any form of a home page?
- ‘paged’ in wp_query doesn’t work
- Merged two WP_Queries, posts per page and pagination not working
- “paged” in WP_Query returns 0 posts
- Pagination on template page for custom query redirecting to index.php
- filter posts by meta key with pagination
- Why won’t my paged wp_query work? [duplicate]
- Pagination not working in secondary query
- How can i retrieve default post per page value? from settings->reading. And total number of posts?
- Multiple WP_Query loops with Pagination
- Pagination with custom SQL query
- Different ‘posts_per_page’ setting for first, and rest of the paginated pages?
- paginate_links() adds empty href to first page and previous link
- Custom WP_Query order by post_meta and (author) user_meta
- Pagination with WP_Query is buggy – working for some pages, but not the others
- WP_Query and Pagination on a Static front page
- Pagination with 5 posts per page
- Pagination custom query
- Pagination/infinite scroll with WP_Query and multiple loops
- WP_query and pagination?
- pagenavi with merged wp_query [duplicate]
- Add and in the header while looping over custom query in page template
- Pagination not working on static page
- Display different number of posts from one category on the different pages
- Pagination not working Search posts
- Pagination not working for category posts
- WP Query with offset breaks wp_pagenavi or any pagination
- Search – Ajax – Alter Query Parameters with Pagination
- Injecting content with $wp_query->current_post restarts from zero on paged pages. How to inject content after X posts, regardless of pagination?
- Show single post then all posts (with pagination)
- WordPress pagination link always leads to home page
- Pagination problem after WP_Query with tag filtering
- Pagination stops at page 6
- Using $paged redirects /page/2 to page 1
- Create ONE callback for all page templates, post filter queries + paginated pages, triggering pagination via AJAX
- WP_Query ajax loader detect end of posts
- Storing query variable and then using wp_reset_query
- Pagination of a WP_Query Loop in a child-page page template
- Five posts from a category in footer
- WordPress Pagination changes my template
- wp_query ‘s’, search filter with pagination is not working
- Custom Pagination Layout for Elementor widget
- WordPress pagination not working on template search.php
- Cutom wp_query for geolocation search, pagination not working
- Pagination outside of loop
- Custom Pagination in Shortcode with WP_Query
- Pagination inside of a edit page
- Avoid repeated post on page 2 when excluding one on page 1
- WP Query to have sticky posts first, with pagination and having a joint ‘posts per page’ arg with main loop
- Pagination for blog posts reloading same page [closed]
- How do I get my custom query to work with search results after the first page?
- Removing duplicate values between two wordpress queries
- Custom WP_Query always respond with 200 status even when no entry
- Include latest author posts with pagination in single template?
- Stomping WP_Query in author archive to facilitate pagination with custom queries
- Yoast primary category query modification
- Page navigation doesn’t seem to work when I add offset?
- Pagination in html table is not working
- Paging + WP Query
- I am officially missing something about transient posts
- WP_query paged pagination with excluded category still counts it
- WP_Query orderby random do not repeat infinite scroll – one loop
- Determining what post is displayed out of total posts found
- WP_Query Pagination
- WP_Query, Paginate by Custom Field
- Why is my pagination /page/2 taking me to index.php?
- duplicated posts when using pagination
- How can I have sticky posts while ALSO showing posts from a specific category using one WP_Query?
- WordPress Sub Category Archive, Show Extra Empty Page Number in Pagination
- WP_query pagination on frontpage
- Pagination unique to a widget
- Why pagination is not working with tax_query param?
- paginate_links method doesn’t show second page of my custom wp_query
- Wp_Query Post per page not working?
- 404 page on custom search pagination
- Paging works correctly on local version, but not live?
- Pagination not working in custom loop WP_Query
- Showing the correct number of posts_per_page when avoiding the use of post__not_in
- Paginate nested query of child posts
- How to set up pagination for a custom loop on a global template (author.php, tag.php, archive.php?)
- Combine WP_Query with array of custom data to single loop without breaking the pagination
- WP_Query with Pagination and orderby meta_value_num showing duplicates
- previous_posts_link not working in WordPress pagination
- Pagination not working with WP_QUERY
- WP_Query with meta_value_num and meta_query not paged correctly
- Pagination with WP_Query not working
- Next / previous posts link doesn’t show up with Posts 2 Posts
- wp_query pagination links producing 404
- Pagination With Custom WP Query not functioning
- Query specific number of posts for each post type in specific order
- WP_Query breaks pagination
- Pagination doesn’t work for home page custom post type query
- Loop issues when creating custom query for media uploader
- Query multiple taxonomies with pagination
- paginate_links() with Custom Taxonomy
- Pagination problem with multiple loops on the same page
- error with $query->have_posts()
- Pagenavi with archive page
- Limit paginated result set to a maximum number of posts