0
我有一個新聞部分,顯示帖子只與「新聞」類別。代碼如下所示。日期不顯示Wordpress上的連續帖子
問題是,只有第一個新聞文章會在它上面找到一個日期。最近的「新聞稿」之後的所有帖子都沒有日期。任何人都知道爲什麼會發生這種情況?
<div id="news">
<?php $my_query = new WP_Query('category_name=news&posts_per_page=6'); ?>
<marquee ONMOUSEOVER="this.stop();" ONMOUSEOUT="this.start();" direction="up" scrollamount="2" id="newsMarquee">
<?php if (have_posts()) : while ($my_query->have_posts()) : $my_query->the_post(); ?>
<div class="post">
<p class="date"><?php the_date(); ?></p>
<?php the_content('Read the rest of this entry »'); ?>
<div class="clear"></div>
</div>
<?php endwhile; endif;?>
</marquee>
</div><!-- /#news -->
真的很好,謝謝你回答你自己的問題!繼續這樣做! – 2012-09-16 16:37:45
@HenriqueFoletto:我盡我所能。 – Amit 2012-09-17 17:14:45
'the_time'比'the_date'好幾千倍,它工作得更好,它可以在一個循環內多次使用!感謝分享! – 2012-09-17 19:54:51