Archived topic
Show "Updated Post Date" in Header Element
3 replies · Started by Tommy on September 25, 2018
Hi, I've read and implemented this for the blog posts page and works:
https://docs.generatepress.com/article/show-the-updated-post-date/
...but would like to show this in the Header Element as well.
Here's the header element [code]:
https://cl.ly/1f9b45d1f5d8
Here's the header element [public facing]:
https://cl.ly/af1a2d06c070
Thanks, and pardon my ignorance - I'm not a coder :)
Hi there,
we can do this by creating a shortcode:
function post_modified_date(){
return get_the_modified_date();
}
add_shortcode( 'modified_date', 'post_modified_date' );
https://docs.generatepress.com/article/adding-php/
Then you just need to add the [modified_date] to the Header element content
Awesome - that works! Thank you!
Glad i could help :)