Sort in WP_Query(), not filter? Is it possible?
If you want to sort the posts by the meta post_views_count, and still include posts that do not have that meta, you can use meta_query like so: ‘meta_query’ => array( ‘relation’ => ‘OR’, // make sure it’s OR // Include posts that have the meta. array( ‘key’ => ‘post_views_count’, ‘compare’ => ‘EXISTS’, ), // Include … Read more