I had create a custom field “date” with this format 16/09/2013 (d/m/Y).
How can i compare date and show only post with date from today ?
This is my query that don’t work !!
$args = array(
'posts_per_page' => 100,
'meta_key' => 'date',
'orderby' => 'meta_value',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'city',
'value' => 'London',
'compare' => 'LIKE'
),
array(
'key' => 'date',
'value' => date("Y/m/d"),
'compare' => '>=',
'type' => 'DATE'
),
)
);
Take a look at meta.php:777:
So if you want to use DATE comparisons, you should use MySQL compatible date formats (YYYY-MM-DD).
Change this part of your code:
to:
and it should work just fine.