我正在運行此查詢來打印出我的帖子。它的作品,但我想添加一個參數,告訴系統只顯示從今天或將來發布的帖子!wordpress:只顯示今天或將來的帖子
下面是該查詢:
$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
);
我試圖做類似&post.date = <= $today
,但沒有奏效。
請問誰能告訴我該怎麼做?
我的想法是告訴查詢只顯示發佈日期是今天或「少於」的帖子。這就是爲什麼" <= "
。
不知道你是否看過這個-http://stackoverflow.com/questions/9317244/wordpress-only-show-future-posts-minus-one-day – McNab 2013-03-24 16:11:58
我沒有意識到WordPress可以展示未來的帖子。這些年來,我一直在做錯事。 :-) – 2013-03-25 00:56:59