Archived topic
Updated Date to Show on Single Posts
9 replies · Started by Georgios on October 4, 2020
Hi,
Tried below CSS code that works correctly to blog posts overview page, but in single blog posts, the date is the published and not the updated one.
.posted-on .updated {
display: inline-block;
}
.posted-on .updated + .entry-date {
display: none;
}
.posted-on .updated:before {
content: "Last Updated ";
}
Thank you for your support.
Hi there,
try this CSS:
posted-on .updated,
.page-hero time.updated {
display: inline-block !important;
}
.posted-on .updated+.entry-date,
.page-hero .updated+.entry-date {
display: none;
}
.posted-on .updated:before,
.page-hero .updated:before {
content: "Last Updated ";
}
Hi David,
Even i need this option. when i added this code in the additional CSS no dates were displayed in my single posts.
can you please let me know how to fix it.
Also should I open a separate thread or if this is fine ?
Thanks
Hi Adbul,
Also should I open a separate thread or if this is fine ?
Yes you can open a separate thread/topic adding your own details to it (link to site, details to issue, etc) so we can craft the best answer specifically for your site.
We'll make sure it'll get addressed. Thank you.
Hi David,
All good now. Kept the first CSS for the overview page plus yours for the single posts pages.
Based on other posts I have to add a date filter as well as Tom provided previously so as Google to pick up only the updated date?
https://generatepress.com/forums/topic/date-not-updating-in-google/page/2/#post-1308177
Thank you for the valuable support!
George
Glad to be of help.
Tried also adding a date filter as well as Tom provided previously so as Google to pick up only the updated date: https://generatepress.com/forums/topic/date-not-updating-in-google/page/2/#post-1308177 but it doesn't seem to work.
Both dates are still showing in the code.
For the header elements you can use this snippet:
Hi David,
the header element works OK.
Google reads and shows the posted date vs the updated date. Per Tom instructions (https://generatepress.com/forums/topic/date-not-updating-in-google/page/2/#post-1308177 ), from what I understand, there is a function that I can use so as to remove the posted date from page source code when the updated date is present.
Thank you!
George