【发布时间】:2011-04-11 08:41:52
【问题描述】:
所以我正在尝试创建一个 wordpress 插件来存储某个月份所写帖子的所有日期。因此,如果本月 10 日、12 日和 18 日发布了帖子,我想将这些日期“10”、“12”和“18”存储在数组$stack[] 中。我是 php 新手,所以我不知道为什么这不将日期存储在数组中:
// The Query
$themonth = date( 'n', current_time( 'timestamp' ) );
query_posts('cat=4&month=' . $themonth );
// The Loop
$stack = array();
while ( have_posts() ) : the_post();
$stack[] = the_time('j');
endwhile;
有什么想法吗?
【问题讨论】: