shuangmiles
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Looking to sort by multiple custom fields in with wp_queryThanks I think I got it to work except how do I specify that ‘rank’ is a meta_val_num i noticed it some pages it’s reversed order and I think it’s reading the number as a string still?
'meta_query' => array( 'relation' => 'AND', 'rank_key' => array( 'key' => 'rank', 'orderby' => 'meta_value_num' ), 'position_key' => array( 'key' => 'position' ), 'last_name_key' => array( 'key' => 'last_name' ), array( 'relation' => 'OR', array( 'key' => 'department', 'value' => $team, 'compare' => 'IN', ), array( 'key' => 'second_department', 'value' => $team, 'compare' => '=', ) ) 'orderby' => array('rank_key' => 'ASC', 'last_name_key' => 'ASC' )