i have a little problem: I can not order my events as i wish. I would like to order my upcoming events in ascending order...
I am using the following:
new WP_Query(
array(
'author' => $current_user->ID,
'post_type' =>'tribe_events',
'orderby' => 'meta_value',
'meta_key' => '_EventStartDate',
array(
'key' => '_EventStartDate',
'value' => date('Y-m-d'),
'compare' => '>='
)))
But nothing happens... i mean they don't get sort in any way.. I think this is because of the _EventStartDate witch includes an hour and it looks something like this if i echo it "2013-07-29 20:00:00". Any suggestions?
updates of the code :
global $current_user;
get_currentuserinfo();
$author_posts = new WP_Query(
array(
'author' => $current_user->ID,
'post_type' =>'tribe_events',
'orderby' => 'meta_value',
'order' => 'DESC',
'meta_key' => '_EventStartDate',
array(
'key' => '_EventStartDate',
'value' => date('Y-m-d'),
'compare' => '>='
)));
while($author_posts->have_posts()) : $author_posts->the_post();
and here i just get the content...