pre query change order
add_action( 'pre_get_posts', 'cd_sort_staff' );
function cd_sort_staff( $query ) {
if ( $query->is_main_query() && !is_admin() ) {
if ( $query->is_tax() || $query->is_post_type_archive('staff') ) {
$query->set('orderby', 'meta_value_num');
$query->set('meta_key', 'sort_order');
$query->set('order', 'ASC');
}
}
}