Title: WP_Query
Last modified: August 20, 2016

---

# WP_Query

 *  Resolved [cstoltenkamp](https://wordpress.org/support/users/cstoltenkamp/)
 * (@cstoltenkamp)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/wp_query-4/)
 * Hello
 * I use WP_Query() with a predefined $Arg array()
    Like $q = array( “paged”=>$var_paged,“
   post_per_page”=>$var_paged, “orderby”=>$var_orderby, “order” => $var_order);
 * Before I pass the $q var I see in my debugger the right values.
 * Then a call new Wp_Query($q), that works for the order, vars paged and post_per_page,
   but orderby is ignored.
 * If a do
    $query = new WP_Query( array ( ‘orderby’ => ‘title’, ‘order’ => ‘DESC’))
   it works …. why is there a different, I did not try it with paged etc.
 * Also I like to know how to pass a date range to WP_Query.
 * Now I use add_filter like $filter = add_filter(‘posts_where’, ‘filter_where’);
   
   where filter where returns this string $where .= ‘ AND post_date >= “‘.$_GET[‘
   iDate’].'” AND post_date <= “‘.$_GET[‘oDate’].'” ‘ ;
 * My idea is that there are several solutions to query WordPress and that I mix-
   up that in a way it not works correct.
 * I hope someone can help me out.

Viewing 1 replies (of 1 total)

 *  Thread Starter [cstoltenkamp](https://wordpress.org/support/users/cstoltenkamp/)
 * (@cstoltenkamp)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/wp_query-4/#post-3072629)
 * Found, fieldname where false.
    With debugging query.php I found the fault. Orderby
   title is not orderby post_title but just orderby title!

Viewing 1 replies (of 1 total)

The topic ‘WP_Query’ is closed to new replies.

## Tags

 * [query](https://wordpress.org/support/topic-tag/query/)
 * [wp_query](https://wordpress.org/support/topic-tag/wp_query/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [cstoltenkamp](https://wordpress.org/support/users/cstoltenkamp/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/wp_query-4/#post-3072629)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
