Archived topic
Blog Post Updated Hook
15 replies · Started by Sam on April 14, 2021
Hello,
Is there a hook I can enter for it to show when my blog post was updated?
Thanks,
Sam
Hi there,
do you want to display an Updated Date on your posts ? As well as the published date ?
let me know
I was thinking just the updated date. Do you know if there is any SEO benefit to having both?
Thanks,
Sam
Hi Sam,
This article should be helpful:
https://docs.generatepress.com/article/show-the-updated-post-date/
I think it's just personal preference.
Let me know :)
Hello,
Thank you, just the updated date will be good. Thanks!
Hi there,
Try this PHP snippet:
add_filter( 'generate_post_date_show_updated_only', '__return_true' );
https://docs.generatepress.com/article/generate_post_date_show_updated_only/
Here's how to add PHP - https://docs.generatepress.com/article/adding-php/
Thank you. Where in the PHP do I need to add this code?
Thanks,
Sam
Thank you. Where in the PHP do I need to add this code?
You can add it on the bottom of your child theme's functions.php or create a new snippet on Code Snippets plugin.
Hello,
Do you have more details on how to create or find the child theme add this to my site?
Thanks,
Sam
Hi there,
this article explains adding a Child Theme:
https://docs.generatepress.com/article/using-child-theme/
Within that there is a link to download the blank Child Theme.
Hello,
That seems a little more difficult. What is the link to the code snippets plug-in?
Thanks,
I found the plug-in. How do I add the code to snippets plugin? Thank you
Hi Sam,
You just need to add a new snippet, paste the PHP code to the red box area, hit save changes and activate button, that's it.
https://www.screencast.com/t/jQWyKLY3
Hi,
I am very confused about it too.
I need to show the updated date on the article and SERP both.
* dont want to show original date in the post
* date modified should look like as it was the original publish date ( it shouldn't show text 'modified date on the post, but just like the original date look like---- April 16, 2021 by Author name----
Thank you, that worked!