I believe the mistake is using get_query_var( 'paged' )
: this comes from the main query, not from your custom query. Try this (untested):
$current_page = 1;
if ( isset( $_GET['page'] ) ) {
$current_page = absint( $_GET['page'] );
}
And then replace uses of get_query_var( 'paged' )
with $current_page
.
Related Posts:
- Page template query with WP_Query
- How to display page content in a page template?
- get_query_var( ‘paged’ ) not working outside of homepage
- How to remove_query_arg() for paginate_links()
- How to paginate attachments in a secondary query as gallery?
- Get the number of posts from the current page results
- Does WordPress generate an automatic page for post formats?
- Why does pagination always break when used on any form of a home page?
- Paginated pages are showing correct content but pagination links are not
- Single page theme that uses pages for the content
- ‘paged’ in wp_query doesn’t work
- Trying to list out child pages with WP_Query
- Using next/previous_posts_link with customised search
- Search – Ajax – Alter Query Parameters with Pagination
- Order by menu structure
- $wp_query->current_post restarts from zero on paged pages
- Targeting specific pages in the loop
- Merged two WP_Queries, posts per page and pagination not working
- What are the differences between “Latest Posts” and “Static Page”?
- WP_Query not retrieving by random order under parent
- WP_QUERY loop, offset in the arguments and the paginate_links – can these work together?
- Using $paged redirects /page/2 to page 1
- Set if condition with wp_nav_menu
- Set order of returned items in the WP_Query() class/function
- Search pages that are a child of the current page
- paging in WP_Query on static page
- How to display summary content from a Page (Not a Post) on another page
- Serve specific “template” page at any URL that ends in its slug
- Masonry, WP_Query & paged – first page repeating, second page not loading
- Pretty urls for custom pagination
- Display custom tags on pages that have a specific page parent
- Is there a reason why Pages are not publicly_queryable?
- Why post__not_in is ignored?
- Exclude parent with child pages from WP_Query
- “paged” in WP_Query returns 0 posts
- Pagination on template page for custom query redirecting to index.php
- Create a loop on my pages with new “WP_Query”
- All blog data on a page using custom query gives 404 for page 2 and onward
- When listing child pages run out of memory
- WPQuery calling specific posts problem
- WP_Query with multiple orderby NOT working with ASC and DESC, what’s wrong?
- Display specific page (that is child) content on parent page
- Get query results with a page title
- How to get current page nearest parent id?
- How to get main menu only with wp_nav_menu
- Unable to paginate a custom page query
- How to create single page site in WordPress
- WP_Query orderby random do not repeat infinite scroll – one loop
- filter posts by meta key with pagination
- Determine if ID is page or post and query the ID
- How to query for a page, get data, then query for child pages of that page
- Get list of all Grandchild Pages
- Custom query does not find pages
- How to get pages of parent (non-recursive)?
- Having a variable based on $post_count increase when i move to the next page of results
- WP Query and multiple pages
- How to use custom page for all posts with custom url, call another directory?
- paginate_links method doesn’t show second page of my custom wp_query
- display the children of the post using the current page as the main parent
- pages shortcode filtering by category
- Paginate nested query of child posts
- How to create page that lists tags by initial letter?
- Get a page ancestor from a most viewed list
- How can I use a specific wordpress page template if certain words are used in page title [closed]
- Category Archive not working for pages
- Retrieving category pages from subcategory returns empty sets
- Issue in If else condition [closed]
- Show parent’s child and also child’s, child on a page?
- Pagination is not working on custom query inside a custom home page template
- Next / previous posts link doesn’t show up with Posts 2 Posts
- get contents and permalink from a specified page
- Hierarchical List Pages as a table
- Why won’t my paged wp_query work? [duplicate]
- Pagination not working in secondary query
- Get next post when using pagination with WP_Query?
- WordPress pagination returns the same posts
- error with $query->have_posts()
- How to write short code with if else to get page_id?
- Pagination only showed when no category is set in wp_query
- Rewrite URL custom search query
- Multiple WP_Query with pagination shows Page/2 content on the remaining pages
- How to do a wp_query using “BETWEEN” with two meta_values?
- meta_query on a date range using an array of values
- How to prevent writing duplicate loops?
- Taxonomy search/filter with multiple taxonomies and multiple taxonomy terms
- how to handle multiple ajax wordpress queries?
- wp_Qwery works to slow
- Using custom taxonomies in a query
- WP_User_Query and user posts
- My website is getting too many dierect home arechives and this is increasing my bounce rate
- Trouble passing attribute into shortcode function
- WP_Query return posts in wrong order
- Exclude post with taxonomy and from the terms (taxonomy & tag) posts count
- How do i create a custom post query when the meta value is an array?
- How to query 5 users in random who have published more than 10 posts
- WP_Query returns images but post_per_page is incorrect
- Where to find WP_Query class?
- How to know which editor published a post programmatically?
- Add custom argument to WP_Query and modify SQL where clause
- How does Show Posts based on a keyword search work in WP_Query