Hi,
Please, this should work , i don’t why it does not….
try to only get spectacle of the current month.
dates_0_date_spectacle is a repeater field should return something like dd/mm/yyyy
so i extract ‘mm’ with substr and compare it to $month
$today = date("d/m/Y");
$month = substr($today, 3,2) /// '02' (february)
$args = array (
'post_type' => 'spectacle',
'meta_key' => substr(get_field('dates_0_date_spectacle'), 3,2) ,
'meta_value' => $month ,
'meta_compare' => '=',
);
Hi @pipoulito
Thanks for the post.
Due to the save format of the date picker field, to successfully order your posts the format has to be yymmdd($php = “Ymd”).
You can add this to your query logic to sort the posts.