Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

The following query stopped working all of a sudden and I can't figure out why.

<?php
$today = date("Y/m/j"); 
query_posts(array(
    'post_type' => array('events'),
    'meta_key' => 'event_date',
    'post_status' => 'publish',
    'orderby' => 'meta_value',
    'order' => 'ASC',
        'meta_query' => array(
            array(
                'key' => 'event_date',
                'meta-value' => $value,
                'value' => $today,
                'compare' => '>=',
                'type' => 'CHAR'
                )
         )
   ));
?>

No plugins have been installed and no one thouched the code, and I have no php/javacript error on the page.

If I disable value in the meta_query, the posts show up fine, only there is no point of the query without it...

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

should 'type' => 'CHAR' actually be 'type' => 'DATE'

the Codex might help on the possible parameters you need here

share|improve this answer
    
How come it worked with CHAR before? –  elbatron Sep 3 '12 at 20:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.