Archived topic
How to insert the published date and updated date in post or page content
7 replies · Started by Nacho on March 28, 2020
Hello there,
I want to show in the page content the updated date and the published date. How can I achieve this? I ´ve search a lot in the forum but nothing about inserting it in the content.
Thanks a lot.
Hi there,
Try this CSS to start with:
.posted-on .updated {
display: inline-block;
}
Adding CSS: https://docs.generatepress.com/article/adding-css/
Let me know if this helps :)
Hello Leo,
Ok, done!
Now how do I insert the date in the content?
Thanks a lot.
Sorry what do you mean by inserting date in the content?
Hi Leo,
Well to insert the published date of the post in the article content so I can say something like, "Keep in mind this article has been published on 28-03-2020".
For example, for current date there is something where you put %%current_date%% or something like this in the article text and you get the current date.
So I can warn users when the article has published in other places that what GP usually shows them.
Hope it makes sense.
You can try creating a shortcode like this:
https://stackoverflow.com/questions/36671203/wordpress-publish-date-shortcode
Hello Leo,
It worked like charm.
Thanks a lot.
Have a nice day.
No problem :)