[resolved] Date issue in Categories (3 posts)

  1. roadchild
    Posted 7 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.
    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...'); ?>

    Any ideas?

  2. stvwlf
    Posted 7 years ago #

    From this codex page:

    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
    Posted 7 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