Tme ago alignment

Posted in: Newspaper
Post count: 96

Hi, I would like to align time ago on the theme with the styling on the dates being replaced. The time ago is not aligning with other metas.
https://imgur.com/a/li24Own
As you can see on the link above time ago is in different color and position compared to dates.

I would also like to add time ago on category templates, I was not successful in getting which template to edit. I will appreciate you guidance.

Thank you.

Post count: 35449

Hi,

You can try some templates from tagDiv Cloud Library using those templates you’ll have more control over the style and layout from them.

If you want to use some custom css please provide me a link were I can inspect this problem!

The file for category is wp-content\themes\Newspaper\category.php
-> https://www.screencast.com/t/UykAMIgA8H

Thank you for your understanding!

Post count: 96

I have been patiently waiting for a reply but you have not even given me a solution of any of my two questions. I have explained myself well and even attached a screenshot. Am already using cloud templates on my categories. Please get serious and review my questions.

Post count: 35449

Hi,

Sorry, but I could not figure it out from your screenshot if is a cloud template or not, sorry;
If you want I can help you to align the time ago, and change the color with a custom css, but in order to do that I will need a link where I can inspect this problem.

Thank you for your understanding!

Post count: 96

https://kenyannews.co.ke/business-news/

I need to change the dates on the cloud category templates to time ago. Which file do I need to edit?

If you are unable to get me just leave someone else to answer.

Post count: 96

I want the results to be like this: https://wizimatic.com/category/entertainment/

(Changing dates to time ago, replacing dates).

NB: I have the code for time ago.

Post count: 35449

Hi,

So if you want to have in all blocks in pages/ categories … the time ago you need to set this code
$buffy .= ' - '. human_time_diff( get_the_time('U', $this->post->ID), current_time('timestamp') ) . ' ago';
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!

If there is still a problem or you have more questions, please let me know!
Thanks.

Post count: 96

$buffy .= ‘ – ‘. human_time_diff( get_the_time(‘U’, $this->post->ID), current_time(‘timestamp’) ) . ‘ ago’;

1. Your code above is showing wrong time. All my posts are appearing to have been published ‘3 months ago’.
I would also like the time ago to revert to normal dates after 7 days.

2.<?php echo ( get_the_time(‘U’, $this->post->ID) > strtotime( “7 days ago” ))? human_time_diff( get_the_time(‘U’, $this->post->ID), current_time(‘timestamp’) ). ‘ ago’ : $this->get_date(); ?>
Am using the code above on my flex blocks eg on td_module_flex_1.php and the codes works well and reverts to normal date after 7 days

How do I align ‘time ago’ maintaining the color as that of ‘date’?

Post count: 35449

Hi,

So if you want to use your code you’ll need to go first in
wp-content/themes/Newspaper/includes/wp_booster/td_module.php
and
wp-content/plugins/td-cloud-library/includes/tdb_module.php
and comment the td-post-date class
-> https://www.screencast.com/t/XpmJdfUBsF
-> https://www.screencast.com/t/KzdSyWOfKX
Now for example we edit flex block 1
-> https://www.screencast.com/t/ogChT9ydUD
For post loop 1 -> https://www.screencast.com/t/Pt5d9Qrp
Doing this the post date will be align and get the color/fort.
Results: -> https://www.screencast.com/t/anaT9cWw

Thank you.

Post count: 96

Hey man! Whats wrong with you?
First you did not answer my first question neither did you answer my second question.

The code you gave me yesterday is showing wrong time.

Second; just give me the code which will align time ago with dates on the blocks, its not a must I use the code I pointed.

Post count: 35449

Hi @dennis!

I already told you that all you need to do is to set that class in your code, lets try again set this class ‘<span class="td-post-date">' in your code, do not forget to close it ' </span>' -> https://www.screencast.com/t/MNOrYM8Yha6H
this is all you need to do and you’ll get this results: https://www.screencast.com/t/T5WVLaPF2Wyl
Please note that you’ll need to set your code for each module were you want to have the time ago.

P.S Please notice that your support has been expired, as you can see here -> https://www.screencast.com/t/PrGi2V66n , if you have other license keys please add them to your product keys account.

Thanks for your understanding!

Post count: 96

Am still unable to solve the issue on the categories. Am getting wrong time ago from my code and the code you had given me.

I also need the time ago to revert to dates after seven days.

Post count: 35449

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
Also the code provide by me is get from here -> https://codex.wordpress.org/Function_Reference/human_time_diff

Thank you!

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