1

我在这里运行此查询以在我的 wordpress 索引页面上打印出帖子:

query_posts( $query_string . '&order=ASC' . '&post.status=future,publish' );

它为我提供状态为发布或未来升序的帖子。现在我想添加一个过滤器,这个查询只显示今天的帖子。因此,在当前日期已发布的帖子。

你能帮我解决这个问题吗?我尝试了很多,但没有任何效果或改变任何东西,所以我希望你们有一些意见。

提前非常感谢!

4

1 回答 1

0

也许是这样的:

$today = getdate();
$year=$today["year"];
$month=$today["mon"];
$day=$today["mday"];

query_posts( $query_string.'order=ASC' . '&post.status=future,publish'.'&year='.$year.'&monthnum='.$month.'&day='.$day );
于 2013-03-22T20:59:44.800 回答