I am trying to sort pages by a custom field which has the 'yyyy/mm/dd' format. The problem I have is no matter what I have tried I keep getting the list back in alphabetical order by title.
Is there anyway to do a query outside the loop and have the pages returned in the sorted order?
$args = array(
'parent' => 462,
'child_of' => 462,
'sort_column' => 'Date',
'post_status' => 'publish',
'sort_order' => 'ASC'
);
$pageposts = get_pages($args);
I did try with this as well, but I still cannot seem to get it to work.
$args = array(
'meta_key' => 'Date',
'orderby' => 'meta_value_num',
'parent' => 462,
'child_of' => 462,
'post_status' => 'publish',
'order' => 'ASC'
);
$pageposts = get_pages($args);
I did try with meta_value as well as meta_value_num. I am completely lost and am not really understanding why I cannot figure this out. Thank you all in advance for any help. I know this may be remedial to most, so I really appreciate it.