date_query seems to be ignored by wp_query

I’m altering my main wp_query in a pre_get_posts filter in order to improve my site search capabilities.

I’ve successfully achieved searching in taxonomies, but I fail when it comes to the post date ranges. Even the example query in the wp docs don’t work for me.

Read More
$datequery = array(
        array(
            'after'     => 'January 1st, 2013',
            'before'    => array(
                'year'  => 2013,
                'month' => 2,
                'day'   => 28,
            ),
            'inclusive' => true,
        ),
    );
$query->set('date_query', $datequery);

If I print_r the content of $wp_query->request, it doesn’t contain anything related with dates, except for the ordering.

What’s wrong?

PS: WP 3.6.1

Related posts

1 comment

Comments are closed.