Site logo

Archived topic

Adding time to publish date in blog entries and excerpts

9 replies · Started by Marc on November 25, 2021

Viewing posts 1–10 of 10

Hi all, I'm wondering how to time to the date a blog entry is published. I'd like for it to show up in post entries and excerpts at the very at least. I should also stress that I am a very simple man so I'd appreciate the easiest possible way to do this. (I saw something with a link to GitHub somewhere but it both confused and terrified me.)

Ideally, any sort of php or css I can copy/paste would be absolutely wonderful. Thanks!

Hi Marc,

Do you mean you want to add something like published 33 days ago in the post meta instead of the actual published date?

Let me know :)

Hey again, sorry I didn’t explain better earlier, I was very tired. lol

What I’m looking for is something like “Published by Marc on November 26 at 9:30 a.m.” or whatever the order of that info would be. Using the same example, the “9:30 a.m.” doesn’t display right now.

I hope that makes a bit more sense. Thanks!

Hi Marc,

There are multiple ways of doing this. One requires some coding while the other will have you creating your layout through a UI.

The UI way of doing things is by Block Element - Content Template.

See a demo of how it's done here - https://www.youtube.com/watch?v=-ZTQP_KA2xE

This basically allows you to create your template for blog entries. This way, you set your preferred order of post meta items and their "text before" like "Published by".

Hi again, sorry to make this difficult but I'm actually a blind user of Wordpress and use the Classic Editor because of its increased accessibility. As a result, I'm totally unfamiliar with the Gutenberg/block editor and don't know if this method would work for me. Is there not a simple code snippet I could use that would add the time to meta information for posts? I've done that with the code snippet plugin before so copy/pasting something that way isn't beyond my realm of understanding. lol

Thanks for your patience with me. I know my knowledge is somewhat limited.

Hi there,

just a quick check - are you using any other functions to modify the date ? Or is it just the default theme settings ?

And second question - do you have Comments enabled on the site ?

As far as I can remember, I’m not using any functions to control the date information. It should be the theme defaults and I don’t have comments disabled. Not sure if you can tell anything by visiting the page itself, but it’s located at https://www.marcwithamouth.com

You could try the following:

1. Go to Dashboard > Settings > General.
2. Set the Date Format to Custom. In the field provided add: F j, Y \a\t g:i a

This should output the Date at Time

For reference the default value of the Custom field is just F j, Y

Man, I feel dumb. That absolutely did the trick. For some reason, I was thinking that because I had selected a certain time format that it would apply to the meta-data for the post entries. It’s a bit hard to visualize when you can’t see it right in front of you. Anyway, thanks for all of your help and my apologies for wasting your time with this very basic problem.

No apologies necessary - super glad to be of help!

This archived topic is closed to new replies.