Archived topic
author and date
5 replies · Started by Drew on January 18, 2022
Hi, is there any way to modify a blog post date where instead of the publish date it uses the last updated date?
Right now it shows for example, "Jan 18, 2022 by Author". Ideally i'd like it to show "Updated (updated date) by Author"
There is a plugin that does this, but it doesn't work very well so wondering if there is a different plugin or a coding solution.
Thanks!
Hi Drew,
You can try this short PHP snippet.
https://docs.generatepress.com/article/generate_post_date_show_updated_only/
Here's how to add PHP - https://docs.generatepress.com/article/adding-php/
Note: You may need another PHP snippet if you have special conditions like displaying published date if there's no update date. :)
Let us know if this is the case so we can provide the required snippet for you.
Thank you Elvin this worked perfectly. Is there a way to add the prefix "Updated" before the date?
i.e.
Updated January 19, 2022 by Author
Hi there,
simple method using some CSS:
.updated-date:before {
content: 'Updated ';
}
Perfect!
Thanks David.
You're welcome