How To Display Post Last Update Time

Recently I had to do something that oddly enough, never had to do before. It is odd because this is something quite basic and we’ve been using WordPress on a wide variety of sites and project for years. Just goes to show, just when you thought you knew WordPress like the back of your hand, you learn something new.

I found myself updating a particular post several times a day and because there were other people checking on that one page throughout the day. So I really needed a way to display a ‘last updated’ time and of course I wasn’t going to this manually. WordPress already saves this information so why not use it?

Thankfully there is already a template tag for this, the_modified_date tag. You can also use the the_modified_time tag which does the same thing but it seems like the_modified_date has a few more parameters you can make use of.

Yet it still wasn’t quite what I wanted. I didn’t want to use the tag in the theme but on just one particular post. That is easily solved. Install a PHP code plugin like PHP Execution. Then you can pop the tag directly into the post or Page in HTML  mode.

Do You Want A Hands-Free Business?

Then get this guide to help you systemize your business so you'll have more time working on your business.

!
!

Hey! I want to make sure you know what you're getting here. In addition to the guide, you will also receive our memo that includes special offers, announcements and of course actionable information.

Terms and Conditions checkbox is required.
Something went wrong. Please check your entries and try again.
Facebook Comments

3 Comments

  1. Karlyn on February 25, 2011 at 12:36 pm

    Does this work on a wordpress page too, or just post?
    Can you elaborate on how to actually “pop the tag in”?
    Thank you.



  2. Kit on February 25, 2011 at 3:29 pm

    Hey Karlyn,

    According to the info at the above link, it does allow you to use it in pages. Other features include:

    * executes php code in your posts and pages (full, excerpts, feeds).
    * integrates well with WordPress’ visual editor. No need to turn it off.
    * write php code in the usual ” syntax in the html view of the editor.
    * admin section to edit the blog users’ php execution rights.
    * plugin automatically prevents users with no php execution rights to edit posts of users with rights to execute php code.

    This is a sweet little plugin that I use quite often.



  3. Lynette on February 26, 2011 at 10:36 am

    Hi Karlyn, Kit gave you a great run down – you have to first install the PHP Execution plugin – link in the post. Then you can paste the tag in any page or post.