WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Date dissapears on posts made on the same day (6 posts)

  1. getignited
    Member
    Posted 4 years ago #

    Hi there,

    I've got a regular problem that I can't seem to solve regarding the date. If I make two posts on the same day, the older post will lose the date information, with it instead being shown on the newer post. Is there any way I can make the date show up on both posts, regardless of being made on the same day?

    My blog can be found at http://getignited.co.uk/blog

    Thanks

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    Try editing your theme files and changing all references for the_date() to the_time(). If you use the former, the full date is only shown on the first post on a given date. The latter shows the date irrespective of how many posts you publish on any one day

  3. getignited
    Member
    Posted 4 years ago #

    Ah, that's perfect thanks!

  4. garryp
    Member
    Posted 4 years ago #

    Could you share which file this change was made on so that I caqn change it. I am getting no dates, only time, on ALL posts. Or perhaps suggest anoither place for the error.

  5. razor.harrison
    Member
    Posted 4 years ago #

    The_date is only for THE FIRST post in a loop, and ignores all the rest. That's why you must use the_time.

    This is applicable in single.php or any customised loop.

  6. Khaled Hakim
    Member
    Posted 3 years ago #

    This should help:
    Instead of using
    the_date();

    Use the following:
    the_time();

    If you leave the brackets blank in "the_time" function, you will notice that you do not get a date stamp, but a time stamp. To get the date to show instead of the time inside "the_time();" function... use the below:

    the_time('F j, Y');

    You can find the_date(); in your template folder in one or many of the .php files. Simply replace where desired.

    Cheers

Topic Closed

This topic has been closed to new replies.

About this Topic