• 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. Can you help me figure out what could be wrong with this code?
    This is the page: https://www.beckywasserman.com/current-events/

    Thanks,
    Andrea

    https://www.ads-software.com/plugins/acf-field-date-time-picker/

  • The topic ‘meta_query orderby overwritten by publish date’ is closed to new replies.