I am grabbing posts from the WordPress database using this piece of code:
$query = array(
'numberposts' => -1,
'post_type' => 'post',
'post_status' => 'publish'
);
$posts = get_posts($query);
I want to order the posts by a date in a custom field.
The custom field is called netr_event_date_start and contains strings formatted like YYYY-MM-DD (for example 2011-10-24).
How can this be achieved? Thanks for your help.
One idea is:
and another