Order WP_Query results by meta key value in custom query
As written your question is off-topic, as it is purely SQL-related. However, the following 2 solutions translate it into WP-ese. Solution 1 $args = array ( ‘post_type’ => ‘project’, ‘post_status’ => ‘publish’, ‘s’ => ‘testingsearch’, ‘meta_query’ => array ( ‘relation’ => ‘OR’, ‘project_date’ => array ( ‘key’ => ‘project_date’, ‘compare’ => ‘EXISTS’, ), array ( … Read more