我觉得我已经非常接近这一点了,但查询一直显示为空。基本上,我正在尝试查询两个日期之间的自定义值。如果开始日期小于当前日期且结束日期大于或等于当前日期,则应返回记录:
$args = array(
\'taxonomy\' => \'exhibition_type\',
\'term\' => \'faculty\',
\'numberposts\' => 10,
\'post_type\' => \'exhibitions\',
\'meta_key\' => \'start_date_of_event\',
\'meta_query\' => array(
\'relation\' => \'AND\',
array(
\'key\' => \'start_date_of_event\',
\'value\' => $current,
\'compare\' => \'<\'
),
array(
\'key\' => \'end_event_date\',
\'value\' => $current,
\'compare\' => \'>=\'
)
),
\'order_by\' => \'meta_value_num\',
\'order\' => \'ASC\',
\'paged\' => $paged
);
我现在使用的代码不断出现0个结果,我现在陷入了困境。任何帮助都将不胜感激。