I have custom WP_Query call where I want to display CPT by one custom field and order them by another:
$args = array(
'post_type' => 'nehnutelnost',
'post_status' => 'publish',
'posts_per_page' => -1,
'order' => 'ASC',
'meta_key' => 'podlazie',
'meta_value' => '2_nadzemne_podlazie',
'meta_compare' => 'LIKE',
'meta_key' => 'cislo_bytu',
'orderby' => 'meta_value',
);
$query = new WP_Query( $args );