Hello, I want to add post last updated time. See this: http://prntscr.com/8wemf8
How to do this?
Hello Arafat,
The easiest way to achieve this is by using a plugin. Something like: https://wordpress.org/plugins/last-updated/screenshots/
We have not tested these plugins. Some of them might not work with our theme. Try a few of them out and see how they work.
The alternative involves coding:
Use this line:
<?php echo the_modified_date('l, F j, Y', '<div class="the-modified-date">LAST MODIFIED: ','</div>'); ?>
And add it to the loop-single file corresponding to your post template: http://screencast.com/t/35I4CepLEU and replace the get_date code with the one above: http://screencast.com/t/THPFMM9E
Result: http://screencast.com/t/hRATUXtT
You can read more about it here: http://wpcrux.com/wordpress-last-modified-date/
Thank you!
-
This reply was modified 10 years by
Bogdan B..
Hello sir,
I tried to add this code on single template 2 but this thing add extra line that shows last updated time and also published date. I don’t able to remove originally published date.
And For module 14, I also want to show ‘last updated’
Hi
To remove the published date from the theme you have to delete this line of code from single_template_2.php: http://screencast.com/t/UEm8ctq5Zgf
To display the last updated date for module 14 you have to replace this line of code: http://screencast.com/t/vEtBtQ09kEU with this one:
<?php echo the_modified_date('l, F j, Y', '<div class="the-modified-date">LAST MODIFIED: ','</div>'); ?>
Thanks!
-
This reply was modified 10 years by
Andrei L..
Hello, I want to display last modified date in right of username like previous published date was.
Now it display bellow the admin username.
Hello,
You can adjust the position of the modified date by using this css code:
.the-modified-date{
display: inline-block;
vertical-align: middle;
}
result: http://screencast.com/t/sXrtuXhckt
Thank you!
How?
Where i edit and add this code in child theme.
please provide steps.
Thanks
Hello,
You just need to add the code in the theme panel->custom css box: http://screencast.com/t/tcgXqVJnv
Thank you!
I used the code above and it worked great, thank you.
I would like to add the time as well. I am using this code:
<?php echo the_modified_date(‘l, F j, Y’, ‘<div itemprop=”dateModified” class=”the-modified-date”>Updated on: ‘,’ </div>’); ?>
To show:
Updated on: Wednesday, December 9, 2015
But instead, I would like for it to show:
Updated on: Wednesday, December 9, 2015 at 6:30 p.m.
Hello michaellugo,
Please consult this link as reference. Here you can find more type to display your time/date. Please check the link: https://codex.wordpress.org/Function_Reference/the_modified_time
http://screencast.com/t/EEZP8EYBp
Hope this helps and let us know how it goes!
Thank you for the message!
I added the code but the dates on homepage mess up now. The dates on featured section and sidebar are the same now.
Let me know how to fix it.
URL: http://www.techwalls.com/
-
This reply was modified 10 years by
ricky86.
I want published date and last modified date on single post pages ( when post is viewed).
Hello iamkingsleyf,
If you want to display the published date, you have to enable from the panel, like this -> http://screencast.com/t/ojOgCqSSz and if you want to display the last modified date for your posts, please try to check this topic here -> https://forum.tagdiv.com/topic/how-to-make-this/ because there you should find the response for your question.
Hope this helps and let us know it goes!
Thank you for the message!