This is the $args I have set up for my loop:
$args = array(
‘post_type’ => ‘arm_careers’,
‘post_status’ => ‘publish’,
‘posts_per_page’ => -1,
‘meta_key’ => ‘post_date’,
‘orderby’ => ‘meta_value’,
‘order’ => ‘ASC’,
);
‘post_date’ being the custom field. What am I doing wrong?
Still need help with this. The save and display formats are: “MM d, yy”, for what that’s worth.
I tried YYYYMMDD and yymmdd and neither works.
I don’t see anything wrong with that query and it should be working. Is the date field in a repeater, of somehow nested in another field that allows nesting?
is your custom field date picker called “post_date” – because that is a WP parameter. (better off using a different name)
Also, the orderby for a custom field should be:
'orderby' =>'meta_value_num'
Take a look here:
https://www.advancedcustomfields.com/resources/date-picker/
Dan