use human_time_diff function

Posted in: Newspaper
Post count: 29

I used human_time_diff function to make time ago. I have used Module 15 every where.

Here is the code I used in td_module_15.php <?php echo human_time_diff( get_the_modified_time('U'), current_time('timestamp') ) . ' ago'; ?>

and removed the code <?php echo $this->get_date();?>

The problem is that time ago is achieved everywhere except single post listing. How to get time ago on single post listing.

Post count: 23312

Hello alpsbox,

Yes, if you want to achieve the time ago for your date for modules/blocks you should edit the structure of the module which creates the block. In you case, if the module is 15, you should remove the get_date function and replace it with the human_time_diff. Also, if you want to achieve inside the posts the similar behaviour for your date, you should edit the loop-single core files which correspond with the post template used by you. For example, if you are using the post template style 1 you should edit the loo-single-1.php, like this -> http://screencast.com/t/HaBa7OtR0A

Thanks for the message!

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