I am trying to query a custom post type that has a meta value (DATE) that are equal or greater than today. My issue is that some posts have the date stored in the "Ymd" format and others have "Y-m-dTg:i a".
This is what I currently have. It currently isn't ordering properly.
'posts_per_page' => -1,
'orderby' => 'meta_value_num',
'order' => 'ASC',
'post_type' => 'funeral',
'post_status' => 'publish',
'meta_query' => array(
array(
'relation' => 'OR',
array(
'key' => 'service_date',
'value' => date('Ymd'),
'compare' => '>=',
'type' => 'DATE'
),
array(
'key' => 'service_date',
'value' => date('Y-m-dTg:i a'),
'compare' => '>=',
'type' => 'DATE'
)
)
)
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744710050a4589288.html
评论列表(0条)