WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Date issue in Categories (3 posts)

  1. roadchild
    Member
    Posted 5 years ago #

    Can someone take a look at this problem I'm encountering. In a category listing only the first post shows the date, all others the date just doesn't appear.
    http://roadchild.com/test/category/happy-tales/
    This is from the category.php

    <?php while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    			<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
    			<h3>on  <?php the_date('l,F j, Y'); ?>
    </h3> <!--added to show date-->
    			<?php the_content('Continue Reading...'); ?>
    		</div>

    Any ideas?

  2. stvwlf
    Member
    Posted 5 years ago #

    From this codex page:
    http://codex.wordpress.org/Template_Tags/the_date

    SPECIAL NOTE: When there are multiple posts on a page published under the SAME DAY, the_date() only displays the date for the first post (that is, the first instance of the_date()). To repeat the date for posts published under the same day, you should use the Template Tag the_time() with a date-specific format string.

  3. roadchild
    Member
    Posted 5 years ago #

    Ahhh okay thanks, that didn't even occur to me!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags