- This topic has 11 replies, 3 voices, and was last updated 3 years, 5 months ago by
David.
-
AuthorPosts
-
December 6, 2021 at 1:16 am #2039669
Asen
Hey guys,
This should be an easy one but not sure how to make it work. I’ve read some similar post threads in vain.
On single posts, I’d like to show the “date last updated” along with the original published date.
How can I do this?
Many thanks in advance for your help!Regards,
Asen
December 6, 2021 at 4:20 am #2039818David
StaffCustomer SupportHi there,
is this across the site ? ie. home page ( which is using WPSP ), blog/archives and single posts?
December 6, 2021 at 5:10 am #2039881Asen
Hi!
Only on single blog posts.
Regards,
Asen
December 6, 2021 at 1:07 pm #2040420David
StaffCustomer SupportSimplest method is to create your own Post Meta with a Block Element:
https://docs.generatepress.com/article/block-element-post-meta-template/
February 17, 2022 at 1:19 am #2122295Asen
Hey David,
Thanks for that.
I saw the documentation, but it’s still not clear for my how to display the last updated date along with the original published data.
I also saw this document here https://docs.generatepress.com/article/generate_post_date_output/#only-show-updated-date
that shows this code: add_filter( ‘generate_post_date_show_updated_only’, ‘__return_true’ );
but this is only for showing the last updated date and hiding the original published date.Can you please help further?
Many thanks!
February 17, 2022 at 2:36 am #2122359Elvin
StaffCustomer SupportHi Asen,
That documentation is for the default meta of the theme.
And yes you’re correct. It’s only for showing the updated date only.
We can actually do this with CSS if you’re using the default meta. Try this one:
.posted-on .updated, .posted-on .updated + .entry-date { display: inline-block; }
Here’s how to add CSS –
https://docs.generatepress.com/article/adding-css/Note: No updated date will display if the post has no history of modification.
Here’s how David’s suggestion would look like if executed –
https://share.getcloudapp.com/p9uXmZ7AFebruary 18, 2022 at 5:15 am #2123983Asen
Thanks Elvin!
The CSS code didn’t work well, but I tried the David’s approach and I almost did it.
It’s just that there’s no space between “Last Updated On” and the actual date, even though there’s such space when I create the element in WordPress.
Check this out https://paste.pics/6a9ceb15ff6fdd716d0b594275332224 and https://paste.pics/G2UQHAny advice?
Thanks in advance for your help!
Regards,
Asen
February 18, 2022 at 5:48 am #2124032David
StaffCustomer SupportDid you include a space in your before text label:
February 18, 2022 at 5:58 am #2124049Asen
Now I did added a space after “Last Updated On” and it works like a charm.
Thanks for the heads up.Thanks very much!
February 18, 2022 at 6:14 am #2124081David
StaffCustomer SupportGlad to hear that!
February 18, 2022 at 6:28 am #2124099Asen
Actually I had to include a double space on the Last Updated on text in order for it to appear correctly when published.
Not sure why but I’m happy with the result. https://paste.pics/G2VY2February 18, 2022 at 7:35 am #2124192David
StaffCustomer SupportMight be WP stripping a single space. Glad to hear its working for you now
-
AuthorPosts
- You must be logged in to reply to this topic.