• Using default/Kubrick, WP 1.5, and for some reason I’m seeing the date be repeated for each new entry I do, within the same DAY. Like this:

    THIRD POST OF SAME DAY
    April 16, 2005
    [content]

    SECOND POST OF SAME DAY
    April 16, 2005
    [content]

    FIRST POST OF DAY
    April 16, 2005
    [ content]

    I read on the FAQ that by default the date only appears on the FIRST post of the day, and NOT on the subsequent posts. I wish I could get mine to do that! Mine is posting the date every time.

    I’ve done very minor cosmetic changes and been very careful. Any ideas what could be causing this or where to look in the templates for code causing this repetition?

    Thanks! ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The default template uses the_time() (which will appear on every post) with a date format string:

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

    Thread Starter kay9

    (@kay9)

    So should I remove the date format string (the stuff within the parens: ‘F jS, Y’) to get it to stop displaying the day’s date on every post I make during that same day? Sorry to be dense, but I’m new at php . . .

    It’s strange that it’s called “the_time” because my posts don’t ever show the time (on my front page), which is fine with me, but something is causing the danged date to appear under the title of every single post I make — within the same day. It’s driving me crazy.

    Thanks so much for your help! ??

    Thread Starter kay9

    (@kay9)

    Here’s what I had in my index.php file:

    <div class="post">
    <h2 id="post-<?php the_ID(); ?>"><a>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>

    And here’s what I have now:

    <div class="post">
    <h2 id="post-<?php the_ID(); ?>"><a>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <small><?php the_date('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>

    I just changed ‘the_time . . . to . . . ‘the_date’ and left everything else exactly as it was, and it is now working like it was supposed to all along, per this bit from the codex:

    When there are multiple posts published on the same date on a page, the tag [php the_date] will only display the date the first time it’s called.

    Just thought I would update. Thanks again. ??

    Glad you figured it out.

    Don’t let the names confuse you. It may seem strange to some that the_date() can be configured to display the time, and as you’ve seen the_time() can output the date, but that’s because they revolve around the same date/timestamp on a post, but are coded to behave differently for their different purposes (when left to run with default parameters).

    Thread Starter kay9

    (@kay9)

    Thanks! That explanation is exactly what I was looking for.

    Hope my befuddlement helps some other person who wanders through here someday because, by default, my d/l of Kubrick-out-of-the-box was displaying the date on every additional entry within the same day (I swear), and doing so even though the Codex indicates that the default theme is supposed to display the date only once per day regardless of the number of entries you make during that one day.

    That is what really confused me, or just increased my already-high levels of confusion.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Date Repeats Within Same Day’s Posts’ is closed to new replies.