I want to query and SORT in WP_Query(). But whatever I do, it only prints posts with meta_key set up. But I want all the results and just sort them.
This is my query:
$query = new WP_Query(array(
'post_type' => 'my_post_type',
'post_status' => 'publish',
'posts_per_page' => -1,
'meta_key' => 'post_views_count',
'orderby' => 'meta_value_num',
'order' => 'DESC'
));
Any ideas how to make sorting happen? It sorts, but only shows posts with meta_key set up. I want all the posts.
posts_orderby
filter for that.