I’ve found the solution by myself. In brief: use 'order' => 'DESC'
The long story:
Since I was doing the first page query via php (standard loop), and instead, the above is done via ajax, passing pagination (thus page 1 is php, the following are ajax), there was a mismatch about the order.
I was still retrieving what is seemed to be page 1 posts because the query was done with the default ASC
order, while the standard loop works with DESC order by default (date-based). So the posts retrived by ajax were in fact of page 2!
By inverting the order, I now get the right posts.
Related Posts:
- Custom WP_Query order by post_meta and (author) user_meta
- Add and in the header while looping over custom query in page template
- Transient pagination not working properly
- tax_query shows no results if nothing is selected
- get complex results set according to category structure
- Get image of latest post from taxonomies/categories
- How to output different posts per page?
- Is it possible to dynamically get queried term AND taxonomy?
- Empty tax_query array returns an empty array
- Create ONE callback for all page templates, post filter queries + paginated pages, triggering pagination via AJAX
- Multisite pagination issue by multi query archive 404
- Yoast primary category query modification
- Notice thrown when creating numeric pagination on custom query
- WP_Query custom order and pagination
- Unable to paginate a custom page query
- I am officially missing something about transient posts
- Tax_Query using WP_Query not working
- Pagination of custom page with custom fields query
- wp_query with meta_query and tax_query
- list all post who have mutual taxonomy as current taxonomy!
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- How can I get all the posts that are related with a specific taxonomy term?
- Custom query for tag and custom tag from 2 post type
- Custom pagination (Title, date and teaser)
- List posts of terms but exclude one term
- Pagination is not working on custom query inside a custom home page template
- Pagination in custom query in a category page
- Horizontally paginate through sets of blog posts?
- Pagination in WP query with transient API
- Output ACF field dynamicaly within a taxonomy loop [closed]
- Search results stuck on page 1
- Multiple queries and pagination
- When should you use WP_Query vs query_posts() vs get_posts()?
- Pagination when using wp_query?
- How can i retrieve default post per page value? from settings->reading. And total number of posts?
- Nested meta_query with multiple relation keys
- Find out total number of pages in global query on archive page?
- order by numeric value for meta value
- Post_count only shows the number of results per page
- Wp get all the sub pages of the parent using wp query
- Multiple relationship for multiple tax_query in WP_Query
- Multiple WP_Query loops with Pagination
- Pagination with custom SQL query
- Return only Count from a wp_query request?
- How to query for most viewed posts and show top 5
- WordPress Pagination Not Working – Always Showing First Pages Content
- WordPress tax_query “and” operator not functioning as desired
- WP_Query vs get_posts
- get_query_var function not working at all
- get_query_var( ‘paged’ ) not working outside of homepage
- WP_Comment_Query pagination, delving into the unknown
- Usage of the new “posts_clauses” filter in WordPress 3.1?
- Custom Taxonomy and Tax_Query
- Conditional arguments for WP_Query and tax_query depending on if $somevar has a value
- Pagination on a WP_query not showing navigation links
- Different ‘posts_per_page’ setting for first, and rest of the paginated pages?
- How to paginate wordpress [gallery] shortcode?
- Pagination returns 404 after page 20
- Make a WP Query search match exactly the search term
- paginate_links() adds empty href to first page and previous link
- WP_Query: query posts by ids from array?
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- paginate_links ignore my format
- Escaping WP_Query tax_query when term has special character(s)
- Sort posts by category name and title
- Does tax_query really beats meta_query in all situations?
- Combining two wordpress queries with pagination is not working
- How to uniquely identify queries?
- What is the most efficient way of querying posts based on visits and date for current day?
- Query WooCommerce orders where meta data does not exist
- Tax_query terms ID’s using variable
- WP_Query for WooCommerce Products
- pre_get_posts with get_posts
- How to paginate attachments in a secondary query as gallery?
- Pagination with WP_Query is buggy – working for some pages, but not the others
- Get the number of posts from the current page results
- WP_Query and Pagination on a Static front page
- next_posts_link not working for loop called with ajax
- Query causing load because of SQL_CALC_FOUND_ROWS post counting?
- author.php with ACF and CPTs
- Query Custom Meta Value with Increment
- Why is my WP_Query not working when tax_query terms are an array?
- Why does pagination always break when used on any form of a home page?
- When should you use wp_reset_postdata vs wp_reset_query?
- Get posts by meta data OR title
- Pagination with 5 posts per page
- Identify which loop you are hooking into; primary or secondary?
- Pagination shows 404 after a certain number of pages
- Pagination custom query
- Perform query with meta_value date
- WP_Query ordered by custom field that is a date string?
- WP_query taxonomy + get all posts with two terms from same taxonomy
- How to make an activities stream mixing posts and comments?
- Duplicate Queries
- How to query for a week using key => value WP_Query argument notation?
- Finding all results from database within 500 miles of the given latitude and longitude [closed]
- Pagination not working for Custom search form & custom result template
- SQL Statement generated by WP_Query not producing expected results
- Pagination/infinite scroll with WP_Query and multiple loops
- How to create a WP_Query to search the Title or Tag?