Forum Replies Created

Viewing 61 replies (of 61 total)
  • Thread Starter shuangmiles

    (@shuangmiles)

    Thanks 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' )
Viewing 61 replies (of 61 total)