Okay, I found the problem by debugging the query.
It was a generic LEFT JOIN added with the posts_join filter that has not alias the $wpdb->postmeta table which finally leads to the error.
So the sorting is working now without problems.
Related Posts:
- Custom query filter not working on woocommerce category page
- $query->query_var[‘post_type’] not set for pages
- Filter query posts by the count of metas for a meta key
- How to set back query var author_name after unset it?
- Change searched term
- pre_get_posts : ‘post__not_in’ doesn’t work with global variable
- How to change the amount of posts previewed on a page?
- How to reset usual $query on search page to push custom $wpdb query there?
- Merge CPT Taxonomy and Post Taxonomy in $query->set
- New custom post type entries are not sorted correctly in admin using pre_get_posts
- Limiting a filtered query
- Why the pre_get_posts hook can cause apache stopped working?
- excludeCat function reverses order of blog posts
- Run search query again without pagination gives no results?
- Set posts per page for parent category and it’s all children
- Filter multiple different main queries on custom pages
- Modify a query using both a text field and a true/false AFC field
- How do I troubleshoot Maximum execution time of 60 seconds exceeded in updating a Media File?
- Admin Post List table Query filtering “WHERE” for custom post type
- pre get posts not working with Tribe Events
- Custom query_var causes displaying posts archive on front page
- What is the most efficient way of implementing a favorite post system?
- Why does get_the_time(‘F j’) return November 30 for all posts?
- Query by one meta_key and sort by another (possibly NULL value)
- Query & Sort Comments by custom comment meta
- is_archive() doesn’t work on public query var archive pages?
- How to count get_users query?
- Possible to get posts from multiple meta keys/values in a single query?
- Difference between fragment caching and wp_cache
- How to display all posts with today’s same month and day only?
- Select User by Joining Multiple Meta Value Results
- Show featured image as background image from postQuery
- Using $wpdb->update but confused on the WHERE in and SET
- Include posts from feature category in pre_get_posts
- You have an error in your SQL syntax – Help with query
- Make one query for adding entries to database
- add_query_arg() and empty variables inside
- Query Strings and Woocommerce
- Style Post Differently In Query
- WordPress post type “event” query string fix?
- order one custom post type by modified time of another post type
- is_search called incorreclty
- Function to delete a post, it’s children and it’s grand children (half way there already)
- Nested loop : wich way/order?
- How to write: $wpdb->update having WHERE NOT value pair in the array
- Query posts according to specific post meta values
- wpdb COALESCE won’t work
- empty query breaks other queries
- Problem in exploding the_content to array
- Query does not return content
- What is wrong with my wp query, cant exclude the category that i want
- how to insert missing tags into the posts through mySQL?
- Parse query filter in wordpress and relation
- Modify date query by URL parameter using pre_get_posts and $_GET
- How to write update query in WordPress to expire transients
- Query Nickname rather than Display Name in custom Woocommerce plugin
- Get previous posts list
- how to replace old DW site with new WP site? [closed]
- WordPress SQL query to tag all posts containing a specific word on title
- Order terms by count – missing terms
- Querying Advanced Custom Fields
- How to rearrange a pool of posts joined using two queries?
- wpdb update multiple row?
- List WordPress Post and Related Attachments outside of a post page
- Can I include get_posts in this array?
- Custom query Custom-Post-Types creates error
- Formatting a date/time returned from a custom $wpdb query
- Rewrite rule for query params
- Cannot get sql request from Query object?
- WordPress query: merge meta key (number) values and sort
- Question about of query
- Is there any way to get all custom posts and all custom terms with it’s meta in few queries?
- Modify behaviour of “s” parameter in wp_query
- Pulling an ACF into a query
- How to make MySQL search queries with quotes
- Using cron for multiple queries
- Archive query not working correctly
- Custom MySQL Query for Post and Post Meta
- Displaying popular posts
- Exclude sticky posts from query
- How to have more post in a page than in your home page
- Find all posts via SQL beginning with A of type B
- learn to run wpdb class
- Display old posts if no future posts exist
- Access Tables with number prefix
- Can I use $query->set() (in a pre_get_posts() hook) with a custom taxonomy in WP 3?
- how to add a read more button to my blog page?
- How to query different categories on index?
- Print data from wordpress sql query
- How to add multiple values with add_query_arg?
- Query parsing only author ids
- 3 queries to update WordPress
- Ascending & descending posts on same page with IF statement
- Prevent executing query for wp_global_styles
- Meta Query compare with LIKE pulls similar post types: 55 and 155, and 1,155
- How to show sticky posts on all pages of the pagination, not just the first page?
- is it possible to get a list of URLs from post_content directly in a mysql query via phpadmin?
- Get URL parameters with rewrite rules
- is_search called incorrectly
- Trying to Add Paging to Single Post Page