我认为没有参数值Today
正如您在中使用的date_query
.
如果你想返回今天的帖子,那么你应该向date_query
将当前日期存储在$today
大堆下面是您的查询。
$today = getdate();
$args = array(
\'tag_slug__in\' => array( \'destacado\'),
\'posts_per_page\' => 2,
\'post_type\' => \'any\',
\'offset\' => 3,
\'orderby\' => \'rand\',
\'date_query\' => array(
array(
\'year\' => $today[\'year\'],
\'month\' => $today[\'mon\'],
\'day\' => $today[\'mday\'],
),
),
\'post_status\' => \'publish\',
);
$featured = new WP_Query($args);