Support

Account

Home Forums General Issues meta_query orderby overwritten by publish date Reply To: meta_query orderby overwritten by publish date

  • Hi vanderduke, how were you able to fix that? I am having the same issue.
    I am trying to sort posts Ascending based on a Date and Time Picker custom field called: date_and_time_picker. The code I have is the following:

    $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
    query_posts($query_string.’&category_name=events&meta_key=date_and_time_picker&meta_compare=>=&meta_value=’.strtotime(date(“Y-m-d”)).’&orderby_meta_key=date_and_time_picker&order=ASC&posts_per_page=12&paged=’ . $paged);

    For some reason it is sorting using the post date instead. Do you know what could be wrong with this code?
    This is the page: http://www.beckywasserman.com/current-events/

    Thanks,
    Andrea