Balkhis - Vision For Success

Display the Last Modified Date for your posts on Wordpress

Dear Readers, I would like to thank you for reading this post. I highly value your feedback and would like to know more about my readers. Follow me on Twitter

Wordpress now a days is being used as more than a blog. People are using it for many different reasons. One of the cool parts of this software or any other blogging software is that it lets you post mark the date the article was published on. Which is great. But what if you have to make updates and still let the readers know that you updated it.

So basically if you are running a contest, and it is one of your featured posts, so your readers can check it. You can use these codes to display the last date the post was modified on, so they know how recent the information on that contest page is.

Last Modified Date

Well I was thinking about it and I came across a site called Adramis where I found this code.

So basically all you have to do is head over to single.php and/or page.php and search for

Posted on: <?php the_time(‘l, F jS, Y’) ?>

It might not exactly be like that but definitely have something like that. Well now all you have to do is replace it with the codes below:

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 when you write a post, it will show the post date, but once you have modified anything the date will change. This looks like a great tool that you guys can use and implement into your site.



To stay updated with the blog, please consider subscribing to my full feed RSS. You can also subscribe by Email and have new posts sent directly to your inbox. I hate spam as well, so I promise you that you will not be spammed.
Add to Social Bookmarks:
Add this Article to Digg Add this Article to Stumbleupon Add this Article to Del.icio.us Add this Article to Reddit Add this Article to Newsvine Add this Article to Technorati

RSS feed

8 Comments

2008-11-06 21:02:53

Certainly sounds interesting; your readers can know how up to date what they are reading it. Thanks for passing on the information.


 
Comment by Problogineer
2008-11-06 21:35:35

Thats a nice tutorial
Thanks for sharing. :D


 
Comment by Simon
2008-11-07 04:13:19

that’s really handy, but i was also wondering if you know how to create a featured post on the home page?


Comment by Syed Balkhi
2008-11-07 09:58:49

Yes I do. You can either make one specific post sticky by just checking it to be sticked in wp 2.7

Or you can use the technique problogger and JC are using right now. They write all of their features post into featured category and pick the latest ones out to display on the home page.


Comment by Simon
2008-11-07 19:00:39

Thanks Syed, I will probably just wait till 2.7 is released (out of beta stage)

(Comments wont nest below this level)

 
 
 
Comment by webkinz Subscribed to comments via email
2008-11-07 07:40:57

That’s very cool when you have some landing pages on your blog like good lists or something like that. Thanks for the tip!


 
2008-11-07 14:16:35

Its very nice and easily we can know the exact date that the article was published and i really appreciate ur efforts for sharing with us…Implemented

-ZK


 
2008-11-13 09:00:49

Nice thing to make your blog more user friendly and convenient for your readers. Good thing to bring it to our notice. Thanks for the information Syed.


 

Sorry, the comment form is closed at this time.

Subscribe to Balkhis via RSS
Subscribe to Balkhis via Email