- This topic has 16 replies, 4 voices, and was last updated 6 months ago by
Ravi Dixit.
-
AuthorPosts
-
September 15, 2022 at 7:07 am #2343720
Ravi Dixit
Hello, Team!
I want to know how can I show published time as hours, minutes, or seconds ago when the published time is less than 1 day. It should only work for posts which have a published time of fewer than 24 hours. else other posts should show the normal dates.
Please check this example https://prnt.sc/q_JTdGBLoAvy
Also, I want this for the modified date. I have my single post header created using the Elements in GeneratePress. Used the post date as the Updated date. Please let me know how can I make the above changes.
September 15, 2022 at 8:50 am #2343984David
StaffCustomer SupportHi there,
maybe this plugin:
https://en-gb.wordpress.org/plugins/meks-time-ago/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/September 15, 2022 at 10:09 am #2344059Ravi Dixit
This plugin will change for all the posts, but I want the changes for only posts published or updated less than 24 hours ago. All other posts should show the same format date.
September 15, 2022 at 10:46 am #2344081Ying
StaffCustomer SupportIt looks like there’s an option in the plugin to apply to posts published in a specific time frame.
Maybe try to contact plugin support?
September 15, 2022 at 11:35 am #2344102Ravi Dixit
Yes, I just installed the plugin and found the option as well. But after activating the plugin, my post updated time is not showing after the post title. It is completely hidden.
I selected 1 day in “Apply to posts not older than” so the latest posts published or updated less than 24 hours ago not showing the date and older posts are showing the date correctly.
September 15, 2022 at 11:41 am #2344107Ying
StaffCustomer SupportCan you link us to a recently published post where I can see the issue?
September 15, 2022 at 11:54 am #2344117Ravi Dixit
I have shared the link in the Private information field. Also you can visit the old posts on the same site to see they are showing the date.
September 15, 2022 at 12:18 pm #2344129Ying
StaffCustomer SupportHum, I just tested on my end, and it doesn’t seem to have this issue.
Can you provide admin login so we can take a look at the backend?
September 15, 2022 at 12:40 pm #2344149Ravi Dixit
Sure, I have shared the access through the private field.
September 15, 2022 at 2:40 pm #2344216Ying
StaffCustomer SupportIt’s because you are using the
updated
date as the date, but the recent post doesn’t have an updated date, it only has the published date.Try change the date settings in the
single post hero
block element, like this:
https://www.screencast.com/t/MxRCpsB77September 15, 2022 at 3:11 pm #2344231Ravi Dixit
I made the changes aw you suggested but still not working.
Pages are not showing the time as I wanted, they are showing the date.
Also, some posts are showing hours ago time on the homepage if you scroll down to Cricket News Category, but when I open them, they show the date.
Also, I tried updating a post to check but it did not work.
September 15, 2022 at 3:25 pm #2344236Ying
StaffCustomer SupportHave you cleared the cache?
September 15, 2022 at 3:37 pm #2344245Ravi Dixit
Yes, I did!
September 15, 2022 at 4:18 pm #2344261Ying
StaffCustomer SupportAh, the date has to be inside the loop, otherwise, the plugin would not detect the date.
You’ll have to change the hook from
after header
tobefore content
.September 15, 2022 at 10:12 pm #2344419Ravi Dixit
I am not able to find the hook, can you share where I can find it?
-
AuthorPosts
- You must be logged in to reply to this topic.