WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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.