您需要使用date
查询:
$args = array (
\'cat\' => \'1234\', // if category being used
\'post_type\' => \'events\', // if custom post type
\'paged\' => get_query_var(\'paged\'),
\'order\' => \'DESC\',
\'paged\' => $paged,
\'date_query\' => array( // this is the thing you need
array(
\'before\' => array( // this is \'before today\'...
\'year\' => date(\'Y\'),
\'month\' => date(\'m\'),
\'day\' => date(\'d\')
),
\'inclusive\' => true,
),
),
);
$past_events = new WP_Query($args);
您认为“过去”的类别、帖子类型和日期可以在此处进行操纵。