show updated time

Posted in: Newspaper
Post count: 29

hi, i want to show post updated time like “30 min ago” or “1 hour ago”
https://www.screencast.com/t/Ye9Ty1XDjR
plz help me to fix like this

Post count: 23312

Hello dileep,

Please keep in mind that you want to change the structure of the date for modules, you will have to edit the corresponding files according to your block used by you. For example, if you are using the Block 3 you will have to edit the modules which make up this block, like module 1, like this -> http://screencast.com/t/whTutD5OFRyy
You will have to use the following snippet of code, like this ->
<?php echo human_time_diff( get_the_time(‘U’), current_time(‘timestamp’) ) . ‘ ago’; ?>
in the core file, like this -> http://screencast.com/t/ZZYWvi253eL1 Clear all your cache and check the results.

Hope this helps and let us know how it goes!

Thanks for the message!

Post count: 29

hi catalin thanks for your support. after put the code home page disappeared, but i change it a little bit like this ->
<?php $post_id = $this->post->ID;?>
<?php echo human_time_diff( get_the_time(‘U’, $post_id), current_time(‘timestamp’) ) . ‘ ago’; ?>
now it work perfect thank you. http://www.navadhara.com/

Post count: 23312

Hello dileep,

I am glad that it works like a charm.

Thanks for the message!

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