query_posts not working as expected
-
I have this line of code, which I expect to get every post with the custom field “page_views” set, sorted in desceding order. However, it finds no posts, despite the posts having that custom field set.
query_posts( array('posts_per_page' => 1000,'order' => 'DESC', 'orderby' => 'meta_value_num', 'meta_key' => 'page_views' ) ) ;
If I just use the query like this:
query_posts( array('posts_per_page' => 1000 ) ) ;
It gets the posts with no problem. What is wrong with the first query?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘query_posts not working as expected’ is closed to new replies.