i have my wordpress posts with two custom fields 'episode_number' 'season_number'
i want to select all posts with season_number=5(example) , and sort them by episode_number DESC
i've written this
$max_season=5;
$args = array(
'meta_key' => 'season_number',
'meta_compare' =>'==',
'meta_value' => $max_season,
'orderby' => 'episode_number',
'order' => 'DESC',
);
$wp_query = new WP_Query($args);
the selection based on season_number works , but i can't order them , with this code wordpress order them based on the time of publishing
anyone can help me?