我正在为事件使用带有单独日期和时间字段的高级自定义字段。我需要做的是显示所有尚未发生的事件。
到目前为止,我已经设法按日期按顺序显示这些事件,但我现在需要做的是在它们发生的时间之前将每个事件都按顺序排列。时间一到,就需要从列表中删除该事件。
到目前为止,我的事件列表参数看起来像这样......
$today = date('Ymd');
$time = date('H:i:s');
$compCount = array(
'post_type' => 'product',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'comp_closing',
'compare' => '>=',
'value' => $today,
)
),
'orderby' => 'meta_value_num',
'order' => 'ASC',
);
我的日期字段是comp_closing
,时间是closing_time
。
我尝试过使用relation
2 个不同的元数组,但发现让任何东西正常工作都令人困惑。