Hi,
Apparently, I find this code very useful:
<?php echo ( get_the_time(‘U’, $this->post->ID) > strtotime( “5 days ago” ))? human_time_diff( get_the_time(‘U’, $this->post->ID), current_time(‘timestamp’) ). ‘ ago’ : $this->get_date(); ?>
Managed to get this to work on flex_1 and all.
However, I would like to implement the same “Time Ago” date display on loop_2 and cat_grid respectively on the category pages. How can I do so?
Hi,
For category you need to edit tdb_module_loop.php -> https://www.screencast.com/t/SlKfgEMViF -> wp-content/plugins/td-cloud-library/modules/tdb_module_loop.php
So if you want to have in all blocks in pages/ categories … the time ago you need to set this code like this -> https://www.screencast.com/t/lWhmJDCKoL45 -> for cloud blocks -> wp-content/plugins/td-cloud-library/includes/tdb_module.php
and for default blocks in wp-content/themes/Newspaper/includes/wp_booster/td_module.php -> https://www.screencast.com/t/NfJkpSX3
This will solved the problems with the time ago align and color too.
-> https://www.screencast.com/t/Dg43Z86o -> https://www.screencast.com/t/wdlW2jPh
If you want only the time ago all you need to do is to comment the post date
-> https://www.screencast.com/t/IedWkZLvr
-> https://www.screencast.com/t/dJxjmjZ9 -> https://www.screencast.com/t/neMzPzXDW
Hope this is what you need!
Thank you!
Hi,
It does not work, it is showing “2 days ago” for all.
I have seen all your previous answers to the users and tried them before starting this post.
How to show “time ago” only for post within 5 days and only date after that?
Hi,
Unfortunately our theme do not have an option for this, for the moment you can set the time ago on posts templates from tagDiv Cloud Library, this will revert automatic after 7 days -> https://www.screencast.com/t/Xaix2uBqnXDQ , in order to achieve the time ago in post loop/loop2 and category grid you’ll need to make some changes in theme files change the code for human_time_diff to work on those modules, but for this I need time to implement and test the code to work properly.
For the moment I do not have enough time for doing this, but I will be back soon enough with a working solution!
Thank you for your understanding!
Hi, the problem is that your solution does not work for loop and category.