Support

Account

Forum Replies Created

  • After looking on the internet for the last 4 hours, I finally figure it out. You have to put the orderby metadata first, then add a meta_query array to filter through the posts.

    $args = array (
        'post_type' => 'route',
            'meta_key' => 'trip_start_date',
            'orderby' => 'meta_value_num',
            'order' => 'ASC',
            'meta_query' => array(
                array(
                    'meta_key'  => 'route_status',
                    'compare'   => '=',
                    'value'     => 'not-yet-launched',
                ),
            ),
            'posts_per_page' => '9',
    );
Viewing 1 post (of 1 total)