How to Display the Last Updated Date of Your Posts in WordPress wp lifetime webs
Are you looking to display the last updated date for your posts in WordPress? This helps let your users know how recent your article is for their needs. In this video we will show you how to easily display the last updated date of your posts in WordPress.
Text version of this tutorial:
http://www.wpbeginner.com/wp-tutorials/display-the-last-updated-date-of-your-posts-in-wordpress/
If you liked this video, then please Like and consider subscribing to our channel for more WordPress videos.
Check us out on Facebook:
https://www.facebook.com/wpbeginner
Follow us on Twitter:
http://twitter.com/wpbeginner
Checkout our website for more WordPress Tutorials
http://www.wpbeginner.com/
Summary of this tutorial:
To start this tutorial you would want to connect to your host using FTP:
http://www.wpbeginner.com/beginners-guide/how-to-use-ftp-to-upload-files-to-wordpress-for-beginners/
Navigate to your theme’s folder under your wp-content/themes and find your theme’s name and locate the functions.php.
Navigate to the bottom and insert our code that checks for the published date.
Upload the functions.php back to your site and now when the last edited date is more recent your publish date it will show the last edited date on your site.
Should you have any issues with this tutorial we would recommend taking a look at our articles:
Beginner’s Guide to Pasting Snippets from the Web into WordPress
http://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/
source
Thanks ya, you just saved me a plugin 😄😄
Hello I Wish You Were A Video Lesson How To Put Bhutan In The Main Menu Please?
i want show only updated date not both how can i do it ?
That would be so useful for my website!
Love this idea but its a little more involved than I dare do. Guess I will reach out for help instead. Keep up the amazing videos!
Great tutorials. Thank you!
Interesting
Thanks for this helpful tweak
thanks
Thanks!
most needed feature 🙂
thanks
Informative video!
Does anyone know if there is there a plugin for 'last updated post'? Messing around with the functions.php file is fine if we have written our own theme. But I look after sites for clients, that have themes which are updated constantly. If we are building a new site of course we can do child themes but i believe it is not possible to make a child theme after the site has been up a few years.
Problem is that this is showing up on pages too. How do I get it to just show on posts?
Is this code compatible to be used with french accented letters? Because I getting some errors in my functions.php like:
1) PHP Notice: Undefined variable: custom_content in /wp-content/themes/sahifa/functions.php on line 41
2) PHP Notice: Undefined variable: custom_content in /wp-content/themes/sahifa/functions.php on line 44
The lines between 41 to 45 are the following :
41 $custom_content .= '<p class="last-updated">Dernière mise à jour, le '. $updated_date . ' à '. $updated_time .'</p>';
42 }
43
44 $custom_content .= $content;
45 return $custom_content;
Note that I have updated in your code [$custom_content .= '<p class="last-updated">Last updated on '. $updated_date . ' at '. $updated_time .'</p>';] with some french accented letters because our website is in French, to [$custom_content .= '<p class="last-updated">Dernière mise à jour, le '. $updated_date . ' à '. $updated_time .'</p>';]
I need some clarifications: Is this code compatible to be used with french accented letters?
thanks in advance
But the last updated time is being visible for pages also… is there any code to let it show only for posts?
Great video and tutorial. I have made it work on my site however, I only want it to appear on posts only. It keeps showing up on pages and frontpage. Is there a way for it to appear on published posts only? Thanks and more power!