Archived topic
Adding last updated in the element code
5 replies · Started by aziz on November 14, 2020
Hi team,
please help
I was trying to update the code to add '' last updated date " after the author name.
this is the code I used :
--------------------------------
<h1>
{{post_title}}
</h1>
<div class "hero-meta"
{{post_author}} / }
.posted-on .updated:before {
content: "Last updated: ";
}
--------------------------------
but i didn't work .
please send me the correct code if possible
Aziz
Hi Leo,
No, unfortunately, I tried that. it works fine in posts only.
I have this one " {{post_date}} "
But it will mention only the original date .
Thanks
Aziz
Not sure if I fully understand.
Did you create a shortcode for [modified_date] as the article here?
https://docs.generatepress.com/article/show-the-updated-post-date/#show-the-%E2%80%9Cupdated%E2%80%9D-post-date-in-header-element
Let me know if I'm missing something here.
Hi Leo,
No sorry I didnt add that shortcode yet , where to add ?
in the element area ?
Thanks
Aziz
The snippet can be added using one of these methods:
Adding PHP: https://docs.generatepress.com/article/adding-php/