Order by two meta values – one is a number and the other is text

If the atsc_bod_listing_order meta is a number, then you should set the type argument to NUMERIC like so, so that the meta value is casted as a number which then gives you the correct numerical sorting: ‘listing_order’ => array( ‘key’ => ‘atsc_bod_listing_order’, ‘compare’ => ‘EXISTS’, ‘type’ => ‘NUMERIC’, ),

User query – getting values for custom meta keys/fields

SOLVED. I missed ID field in field array. $args = array( ‘role’ => ‘author’, ‘order’ => ‘DESC’, ‘orderby’ => ‘post_count’, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘medical_diagnosis’, ‘compare’ => ‘EXISTS’, ), array( ‘key’ =’gender’, ‘compare’ => ‘EXISTS’, ), ), ‘who’ => ‘authors’, ‘count_total’ => true, ‘fields’ => array( ‘ID’, ‘user_email’, ‘display_name’), ); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)