Archived topic
How To Change Date To Updated Date
5 replies · Started by Abhishek on April 23, 2021
Hi,
I want to show updated date on post and serp both.
Date in post should be in this format- April 16, 2021 by Authors name
where April 16, 2021 is the modified / updated date. there should be no show of the term such as updated date/ modified date in the article.
Awaiting reply!
Hi there,
This should help:
https://docs.generatepress.com/article/show-the-updated-post-date/
https://docs.generatepress.com/article/generate_post_date_output/
Keep in mind that the upcoming GPP 2.0 will make this much easier so you might want to wait a bit as we are already in RC3:
https://generatepress.com/introducing-the-gp-theme-builder/
https://youtu.be/Ni3KXdZ5Dl8
This is so confusing.
Firstly I am not sure which option should I go with.
I tried adding CSS from here https://docs.generatepress.com/article/show-the-updated-post-date/
but it did not work.
All i need is updated date to show in both post and serp.
this is a sample post https://emulatorclub.com/best-gba-emulator-pc/
the date showing is the date posted on, need to change it to updated date
Awaiting reply.
Hi there,
add this PHP Snippet to your site:
add_filter( 'generate_post_date_show_updated_only', '__return_true' );
as per this document:
https://docs.generatepress.com/article/generate_post_date_output/#only-show-updated-date
Adding PHP: https://docs.generatepress.com/article/adding-php/
Hi,
I added the php snippet as suggested using php code snippet plugin.
Now whenever i edit an article it shows option to add php code in that post. but what about older posts? old posts are still showing the date when they were published instead of the updated date.
The PHP should be applied to all the posts by default.
If you were asked to add PHP code in the post editor, I think it's some functions from other plugins.
Btw I just checked your site, it still shows the published date. Check if the PHP snippet has been activated in code snippet.
Also make sure you have your cache purged and cache plugin disabled after making changes to the site.
Let me know how it works.