WP_Query will ONLY order by post_date column
-
Hello,
In WordPress 5.9, I cannot get WP_Query to order by any column other than the Post Date.
Given the following code:
$args = array( 'orderby' => 'title', 'order' => 'DESC', ); $query = new WP_Query( $args );
The returned query request is as follows:
[request] => SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND ((wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled' OR wp_posts.post_status = 'private'))) ORDER BY wp_posts.post_date ASC LIMIT 0, 10
Note order by statement, ‘ORDER BY wp_posts.post_date ASC’.
It doesn’t matter what kind of query I throw at WP_Query it will ONLY order by the post date!
Please help, I cannot understand how this could be so.
Paul S.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘WP_Query will ONLY order by post_date column’ is closed to new replies.