我有这个问题
<?php
$post_args = array(
\'post_type\' => \'tribe_events\',
\'eventDisplay\'=>\'past\',
\'tax_query\' => array(
array(
\'taxonomy\' => \'tribe_events_cat\',
\'field\' => \'slug\',
\'terms\' => \'compliance\',
),
),
\'meta_query\' => array(
array(
\'key\' => \'associated_people\',
\'value\' => $current_user,
\'compare\' => \'LIKE\'
)
)
); ?>
它调用过去的所有事件,但我需要它只提取从今天起过去12个月内发生的事件,有什么方法可以做到这一点吗?
我正在使用活动日历专业版
提前感谢您的帮助!
SO网友:Lucy Brown
我最后就是这样做的-
<?php
$post_args = array(
\'post_type\' => \'tribe_events\',
\'eventDisplay\'=>\'custom\',
\'start_date\' => date( \'Y-m-d H:i:s\', strtotime( \'-365 days\' ) ),
\'tax_query\' => array(
array(
\'taxonomy\' => \'tribe_events_cat\',
\'field\' => \'slug\',
\'terms\' => \'management-leadership\',
),
),
\'meta_query\' => array(
array(
\'key\' => \'associated_people\',
\'value\' => $current_user,
\'compare\' => \'LIKE\'
)
)
); ?>