Comparing Meta Field date in WPQuery using Meta_Query?

I have dates stored in the format d-m-Y, and i want to display any posts that are in the past, before today.

$args = array (
‘post_type’=>’property’,
‘post_status’=>’publish’,
‘posts_per_page’=> 8,
‘paged’=> $paged,
‘meta_query’ => array(
‘key’ => ‘auction_date’,
‘value’ => date( ‘d-m-Y’),
‘compare’ => ‘<‘,
‘type’ => ‘DATE’
),
);

This doesn’t seem to work and i can’t figure out why. Any suggestions would be much appreciated.

Read more here:: Comparing Meta Field date in WPQuery using Meta_Query?

Leave a Reply

Your email address will not be published. Required fields are marked *