Archived topic
Display "last updated" date instead of "published" date
10 replies · Started by Uwe on February 28, 2019
Hello,
As the title describes, I'm trying to display "last updated" date instead of "published" date for all my blog posts.
I tried the following CSS but it didn't work, unfortunately:
.posted-on .updated {
display: inline-block;
}
.posted-on .updated + .entry-date {
display: none;
}
.posted-on .updated:before {
content: "Last Updated";
}
Hi there,
try this:
.page-hero time.updated {
display: inline;
}
.page-hero time.published {
display: none;
}
Worked, thanks!
You're welcome
Hi David,
I have added above CSS under Appearance - Simple CSS. But no luck. Do I need to modify functions file. If so what code I need to add. Please help.
Here is my site link Software Testing Material
Thanks.
Hi Sumasri,
You can also try this method to show last updated date in your GeneratePress Theme ==>How to Display Last Updated Date in GeneratePress Theme?
Hi there,
you'll find the CSS method required here:
https://docs.generatepress.com/article/show-the-updated-post-date/
The alternative is to use PHP to output the updated date:
https://docs.generatepress.com/article/generate_post_date_output/#only-show-updated-date
I am using this method in a couple of my sites but in a new site, this is not working. I tried using code snippets, gp child theme, and using main themes function, but nothing is working.
But the other sites are perfectly showing update date. What may have gone wrong here? Please help
Hi Kelvin,
Could you open a new topic for this?
You can link us to the site in question using the private information field.
Let me know :)
Hi David?
Where to add below code? I also would like to display “last updated” for my blog posts.
".page-hero time.updated {
display: inline;
}
.page-hero time.published {
display: none;
}"
Thanks,
Hi there,
That code is CSS. Here's how to add it in - https://docs.generatepress.com/article/adding-css/
Although, we can't be sure if that's applicable to your site because that was written for the topic starter.
If that one isn't applicable, can you open a new topic about this? Let us check the site to provide the applicable solution.
Let us know.