• I’m using Custom Fields and a Custom Post Type to display a list of upcoming events.

    I made the field type a date-picker with a format of mm/dd/y D and the template code is:

    $args = array(
    ‘post_type’ => ‘workshop’,
    ‘posts_per_page’ => $num_posts,
    ‘post_status’ => ‘publish’,
    ‘order’ => ‘ASC’,
    ‘orderby’ => ‘meta_value’,
    ‘meta_key’ => ‘date’
    );
    $query = new WP_Query( $args );

    It’s doing exactly what I want it to do BUT… now I have an event happening Jan 2016. So, since Jan is the first month of the year, it’s showing up as the first event in my ordered list. I don’t want this… I want it to be last. Does anyone know how to change the code so it considers the year as well? Thank you so much!

    site: https://www.tribalance.com/workshop/

  • The topic ‘[Plugin: ACF Custom Post Type] orderby that includes year’ is closed to new replies.