Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter ian

    (@ian)

    Ahh, yes hit the wrong button there.
    Erm, the date isn’t showing on every post. This is always on multiple posts from the same day. I vaguely remember the same problem with B2 but cannot remember the fix as things have slightly changed with WP.
    Any help much appreciated

    From the documentation:
    <?php the_date() ?>
    the date of the post. example: 03.07.01 (default is dd.mm.yy).
    the date is displayed only on new days. for example if you got 10 posts on the same day, the date for this day is displayed only once.
    And then in the notes below….
    Note about the_date(): if you want all your posts to bear the date, you’ll have to use the_time() instead, with a date format string. for example, to have all your posts show like “25.12.2001 @ 8:04:50 AM” you’ll have the_time(“d.m.Y @ g:i:s A”). you can also repeat this template tag 2 times with 2 different formats: the_time(“d.m.Y”) for the date, and then later the_time(“g:i:s A”) for the time of the day.

    Thread Starter ian

    (@ian)

    That’s the one, I was staring at my B2 index page for ages and didn’t notice the difference.
    Also a case of RTFM on my part. Many thanks!
    Ian.

    Try putting the values in the_time in quotes, like the_time(‘m.d.y’).
    The syntax is the same as for the date function, the reference is on the options page and here: https://php.net/date .

    Thanks Allusion, I will try that this weekend. ??

    You’re very welcome.

    I also went one step further and added this entire string:
    <*?php the_time(“l, F d, Y”); ?*> @ <*?php the_time(“g:i a”); ?*><*br /*>
    Day <*?php the_time(“z”);?*> of the year.<*br /*>
    There are <*?php the_time(“t”);?*> days this month. <*br /*>
    I’m such a geeky little kid. Show me where to find code and I play with it for an hour! Thank you for that link Allusion, it’s bookmarked in my ever growing code folder!
    The output is:
    Saturday, June 21, 2003 @ 6:44 pm
    Day 171 of the year.
    There are 30 days this month.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Date not showing on every post’ is closed to new replies.