wordpress query will only orderby menu_order

admin

Administrator
Staff member
I'm trying to order a
Code:
WP_query
by
Code:
meta_value
but wordpress doesn't seem to want to change the
Code:
orderby

The query is as follows

Code:
$popular_args = array(
    'post_type' => 'post',
    'post_status' => 'publish',
    'posts_per_page' => -1,
    'meta_key' => 'wpb_post_views_count',
    'orderby' => 'meta_value_num',
    'order' => 'ASC',
);

$popular_query = new WP_query( $popular_args );

The resulting query is as follows

Code:
WP_Query Object ( [query_vars] => Array ( 
    [post_type] => post 
    [post_status] => publish 
    [posts_per_page] => -1 
    [meta_key] => wpb_post_views_count 
    [orderby] => menu_order 
    [order] => ASC 
    [error] => 
    [m] => 
    [p] => 0 
    [post_parent] => 
    [subpost] => 
    ....

You should notice that the
Code:
orderby
value in the query has been set to
Code:
menu_order

Even though I spesifically set it to
Code:
meta_value_num

I've been reseting the query and post data all over the place to try and get the query to play nice by am now out of ideas.

Any help would be awesome

Ps: the query about is being called in a file that is
Code:
required
in the
Code:
sidebar
which is inturn called using the
Code:
get_sidebar()
wordpress function