On one of my main blogs I maintain several reference posts which are updated regularly in the hopes that they remain a valid resource for my readers. So far these posts have proven to be pretty beneficial to search engine traffic and well received by readers that reference them regularly.
If you run a blog where posts are regularly updated, you may want to consider updating your post meta data to also reflect the last modified date when applicable, rather than showing just the original posting date.
In order to do this, Ardamis has posted a quick code hack to get your single pages to reflect the last modified date. He uses the default Kubrick theme, but it easily apply to just about any theme.
As always, you’ll want to make a backup of your single.php file (or any files you will be changing) before proceeding.
Look for the code that displays the post date. It should look something like the following:
Posted on: <?php the_time('l, F jS, Y') ?>
Now replace it with the following code (slightly modified from Ardamis’ post):
Posted on <?php the_time('F jS, Y') ?>
<?php $u_time = get_the_time('U');
$u_modified_time = get_the_modified_time('U');
if ($u_modified_time != $u_time) {
echo "and last modified on ";
the_modified_time('F jS, Y');
echo ". "; } ?>
Now your posts should show the last modified date immediately after the original posting date, rather than just showing the original post date! I use this on most of my blogs and I am very pleased with it.














There Are 6 Responses So Far »
Pingback: Collection of WordPress Hacks
Pingback: 100+ Killer Wordpress Resources | Steffan Antonas' Blog
Pingback: How to: Display the last modified date of your posts
Pingback: Remettez vos vieux billets au goût du jour avec WPX Last Post Mod
Pingback: 12 Lesser Known But Useful WordPress Hacks
Pingback: Stupid WordPress Tricks | Serita
Pingback: WordPress Tricks Part 1 | [ XenriTech ].com
Pingback: [Wordpress] Affichez la date de dernière modification d’un billet - Websourcing.fr
Pingback: 12 Lesser Known But Useful WordPress Hacks | php tutorial
Pingback: 12 Lesser Known But Useful WordPress Hacks | CSS Citadel
Pingback: WordPress code snippets, tips and tricks « Mex714's Blog
Pingback: Amy N Boon » 12 Lesser Known But Useful WordPress Hacks
Pingback: WordPress Tricks,,cuongvu marketing tips | cuongvu marketing tips