Changing dates format

Posted in: Newspaper
Post count: 341

Hello again, I would like to change the dates format and use something like:
* 1 minute ago
* 1 hour ago
* 8 hours ago

Is it possible?

Post count: 341

According to wordpress codex,

For posts
<?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago'; ?>
and for comments
<?php echo human_time_diff( get_comment_time('U'), current_time('timestamp') ) . ' ago'; ?>

but where do I find these codes? Which templates to edit in the theme?

Post count: 854

hi,

in modules files: http://screencast.com/t/4MdlOWQZll we use the get_date() function.

the function is defined here: http://screencast.com/t/W2DQw0Og5F .

Thanks for you message.
Radu A.

Post count: 341

Any idea how I should modify the files to change the time format on whole site?

Post count: 6600

Hi,

You can do it from here: http://screencast.com/t/br8MwDcnv37

Thanks

Post count: 341

@Lucian I don’t want that way. How can I implement human time difference?
The one like “1 days ago”, “2 hours ago” ??

Post count: 6600
Post count: 341

Thanks 🙂

Post count: 341

Hi, some blocks are showing the same time for all articles… like 1 month ago for all or like 16 hours ago for all… 🙁

Post count: 341

And also it needs to be ajax…… 🙁 shit there are lot of problems!

Post count: 6600

Hi,

I have tested this and found no issues with it: http://screencast.com/t/HQvL2clz
Also on category pages: http://screencast.com/t/seT1s9ojF
Please add this , $this->post->ID like this and check again: http://screencast.com/t/IGGByAUT

Thanks

Post count: 341

Thanks a lot, this time it works! I might give you the best support award 🙂
One more thing.. It needs to be working with ajax like the views counter.
Possible? Please?

Post count: 341

Hi Lucian?

Post count: 6600

Hi,

I doubt that this can be done easily, the theme was not designed to work with this time format so if you want to use this you would have to give up caching or you can try to search for a solution to get past cache, I recommend you hire a developer if you really want to do this, this is custom work and we we cannot offer custom work as we work hard on the development, updates, fixes and support.

Thanks

Post count: 341

I’m happy with this much @Lucian thanks. anyway after 1 hours it shows time like 1 hours ago, 2 hours ago so that’s no issue

Post count: 341

I talked to a developer and he said that the theme developers can help. His name is Alex, he told that if they can do it for views then why not for time?

He suggested that there’s a plugin wp-days-ago that already has ajax functionality. So if you guys could help me integrate it or use the ajax function from it? :/

Post count: 6600

Hi,

The theme was not designed to work with this time format and we try not to overload it.
In other words this is custom work and we cannot offer custom work as we work hard on the development, updates, fixes and support. You can hire a freelancer/developer to do this for you or you can use that plugin make some research and try to find a solution for this yourself, you can take a look at the views counts using ajax here: http://screencast.com/t/LAVMQDmY
Sorry for the inconvenience!

Thanks for the message!

Viewing 17 posts - 1 through 17 (of 17 total)
You must be logged in to reply to this topic.