Archived topic
How to add "Last Updated" below Posts Title?
11 replies · Started by To on June 1, 2021
Hi, Support Team
I would like to add like this: Last Updated: November 10, 2019 by author below title of all posts in my site. it will replace the publish date.
So, How do I do That? Please
Thanks,
Hi To,
Can you explain a bit more about how you want it to behave? Will the original post date be the date if there's no post modification?
Let us know.
Hi Elvin,
I just want "last updated" date instead of "published" date and there is words "last updated" before that dates. Thanks!
You can try the suggested CSS and PHP snippet on our brief documentation here -
https://docs.generatepress.com/article/show-the-updated-post-date/
Thanks Elvin
No problem. :)
Hey Elvin, I'm responding here since this matches my question.
I should say upfront that I'm mainly using pages, not posts for my content. That may make the difference here. If it does, please let me know what CSS I should be using to target pages.
I've attempted to follow the directions on the link you shared here, but it doesn't seem to be working. I've added the CSS that was outlined in the page.
.posted-on .updated {
display: inline-block;
}
.posted-on .updated + .entry-date {
display: none;
}
I added that CSS by going to appearances > customize > Additional CSS in the menu.
I just want the text: "Last Updated: [date] to be underneath my H1 for all of my articles.
Do I need to be using the Header Element? I tried that with the PHP snippet but I couldn't get it to display under my H1 either.
Hi Matt,
In this case, I would recommend using the Block element which has the dynamic content feature.
For your reference:
https://docs.generatepress.com/article/block-element-post-meta-template/
https://www.screencast.com/t/d3qploKi8a4D
Thanks so much, Ying. This is very close to what I'm looking for. I followed your screenshot with the block element.
The date is showing; however it's outside of the content container. What settings should I adjust to put it directly below the H1 heading?
You can try to change the element to Hook, use after_entry_header hook.
https://www.screencast.com/t/p7N5ccmh4XF
Let me know :)
That worked perfectly! Thank you!!
No problem :)