The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Test if a Post is the Last of the Day (2 posts)

  1. DanielGenser
    Posted 6 years ago #

    I'm trying to figure out a way to test if a post is the last post of a particular day. Take a look at my blog at http://polaricecap.net and you'll see that each of my posts has a paragraph tag containing the post date off to the left of the title. I'd like the paragraph containing the date to show only if it is the last (or latest) post of the day, so that the a particular day's date only shows once. Another example: Gruber's blog does this at http://daringfireball.net/

    Basically, I'm looking for this:

    IF there is no later post timestamp OR if the next timestamp's date is different, add a class name LAST-DAY to post's container.

    Any ideas?

  2. esmi
    Forum Moderator
    Posted 6 years ago #

    Have you tried just using the_date() instead of the_time()? The former should only only display the date once if you have 2 or more posts on the same day.

Topic Closed

This topic has been closed to new replies.

About this Topic