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
- Find out total number of pages in global query on archive page?
- WordPress Pagination Not Working – Always Showing First Pages Content
- get_query_var function not working at all
- get_query_var( ‘paged’ ) not working outside of homepage
- Pagination returns 404 after page 20
- Make a WP Query search match exactly the search term
- Does tax_query really beats meta_query in all situations?
- Query WooCommerce orders where meta data does not exist
- Show only oldest post by author
- How to get the posts published in last two days using WP_Query?
- Dynamically Override Fancy Title – Part II
- Can not switch the queried post in pre_get_posts hook
- Get term by custom term meta and taxonomy
- Woocommerce custom loop to show all the products [closed]
- Pagination 404 errors for author posts query on author.php
- List the 5 most recent child pages
- Pagination problem after WP_Query with tag filtering
- Pagination stops at page 6
- Paginated HTML Sitemap
- Get list of terms that have posts in another term
- Pagination is broken and I need help fixing it
- Creating a custom search for a specific post type
- WP Pagination on Posts Search Results Page resulting from AJAX WP Query
- Custom query for sidebar isn’t returning results
- paging in WP_Query on static page
- Fetch posts that match term slug first two letters (wp query)
- WP_Query tax query part of slug
- Query posts intersecting tags and categories
- Pagination on static Posts page
- can these 3 queries be re-written as 1 query?
- Modify Search Query if original Query gave no results
- How to cache wp_query with pagination using transients?
- Include current post into loop
- Filter post query to only show direct children of category
- Is it possible to retrieve posts depending on meta_key LIKE condition? [duplicate]
- Paging + WP Query
- How to restrict search on a certain page to only return results against custom taxonomies?
- Query Not working as expected
- max_num_pages says 4, yet I am only able to navigate to the third page
- Paginate pages with dynamic query
- Trouble Making WP_Query paged
- paginate_links appearing on page but it doesn’t actually paginate – pagination on a static page with a dynamic `post_type` argument on a static page
- Query pages created by deleted users
- Display related CPT with custom taxonomy
- WP Query should show No Posts when tax_query $args taxonomies don’t have associated posts
- Exclude post from wp_query based on custom field boolean
- Get posts that match defined arrays of tags
- WordPress post_status and meta_query
- Custom Query Pagination not working on static front page
- WordPress search page pagination displaying but not functional
- Is my code correct?
- Tax_Query not working – connecting to second wordpress database
- Meta query doesn’t remove placeholder escape before query
- Paginated Post List on Front Page
- How can I modify standard search query to include also ACF custom fields values?
- Custom taxonomy and query multi conditions
- Empty ‘terms’ in ‘tax_query’ returns an empty array
- WP_Query: Meta_Query with serialized value (or a workaround)
- How to get query results for the next page
- Archive – Show Page Month Headers
- Query post Pagination Problem
- Pagination for custom query throws 404 errors on last pages [duplicate]
- How to organize a WP_Query’s list of posts by category and display category title?
- Need help setting up a search form for wordpress [duplicate]
- Ordering Custom WP_Query loop by meta key value with pagination
- Pagination in custom query not working [duplicate]
- paginate_links() on page (shortcode output)
- Pagination showing same posts despite changing page
- Pagination on custom post type not working