开发者

Date not showing on consecutive posts on Wordpress

I have a news section that shows posts only with a category of "news". The code is shown b开发者_如何转开发elow.

The problem is, only the first news post gets a date above it. All the posts following the most recent "news post" don't have dates. Anyone have any idea why this is happening?

<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 &raquo;'); ?>
                        <div class="clear"></div>
                    </div>

                <?php endwhile; endif;?>

                </marquee>

        </div><!-- /#news -->


Fixed problem.

Had to change the <?php the_date(); ?>

to:

<?php the_time('F jS, Y') ?>

Hope that helps anyone out there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜