WP_Query not obeying order
-
Hello… I am facing a problem at a query. I have the following WP_Query on a custom front-page.php
$wpq = array ('post_type' =>'video','taxonomy'=>'webtv','posts_per_page'=>5,'orderby'=>'date','order'=>'DESC');
Full code is
$wpq = array ('post_type' =>'video','taxonomy'=>'webtv','posts_per_page'=>5,'orderby'=>'date','order'=>'DESC'); $new_query = new WP_Query($wpq); if ( $new_query->have_posts() ) : while ( $new_query->have_posts() ) : $new_query->the_post(); endwhile; endif;
The wired is that this query returns correct order by BUT it always returns ASC. I have also tried to add ID to check my sorting, yet print_r returns query with .ASC
Same query works on sidebar (not on frontpage) and sorts correct
Same happens with query_posts on front-pageAny ideas?
- The topic ‘WP_Query not obeying order’ is closed to new replies.