WordPress.org

Ready to get started?Download WordPress

Forums

How to display post age? (and how to use age in an if statement...) (1 post)

  1. willrogers88
    Member
    Posted 6 years ago #

    Just wondering how one would go about showing the age of a post, ie, instead of displaying the date a post was submitted, show something along the lines of This post is 3 days old. It seems as though this should be pretty straightforward, but i kind for the life of me find it in the documentation or elsewhere.

    The second part of my question is how you could go about styling posts differently depending on their age, ie. something along the lines of if post was published today, format it in such and such a way, if it was posted in the last week, format a different way, etc etc.

    Thanks in advance, will,

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags