How to add last updated time?

Posted in: Newspaper
Post count: 225

Hello, I want to add post last updated time. See this: http://prntscr.com/8wemf8

How to do this?

Post count: 22421

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..
Post count: 23

Please make this a feature of your theme. Many of us need it.

Post count: 22421

Hi,

I will add this request to our list of updates and fixes but i cannot promise anything just yet. The developers have the last word in what gets implemented. Until then you can use the method shown above.

Thank you!

Post count: 44

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’

Post count: 6535

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..
Post count: 44

Hello, I want to display last modified date in right of username like previous published date was.

Now it display bellow the admin username.

Post count: 22421

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!

Post count: 44

How?
Where i edit and add this code in child theme.
please provide steps.

Thanks

Post count: 22421

Hello,
You just need to add the code in the theme panel->custom css box: http://screencast.com/t/tcgXqVJnv
Thank you!

Post count: 10

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.

Post count: 23312

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!

Post count: 23

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.
Post count: 23312

Hello ricky86,

Please ensure that you have followed correctly all the steps wich are presented above and also, please try to clear all cache and test it again.

Hope this helps!

Thank you for the message!

Post count: 224

I want published date and last modified date on single post pages ( when post is viewed).

Post count: 23312

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!

Viewing 16 posts - 1 through 16 (of 16 total)
The forum ‘Newspaper’ is closed to new topics and replies.