I was wondering if anyone knows an effective way of displaying the last modified date on a Wordpress site.
I'm not interested in the last modified date of a single post or page, but in a date (and maybe time) that shows the last time ANY modification was made on a site.
For example:
- I modify the "Hello World" post on 15/09/18
- I modify the "Sample page" page on 16/09/18
- The "My last modified" displays "16/09/18" on the "Hello World" post and also on the "Sample page" page.
I'm aware of the the_modified_date() and the get_the_modified_date() functions, but I'd like to effectively show the latest from all of the modified content (pages, posts, custom post types, etc.)
Thank you for your suggestions in advance!
You could query the most recently updated posts and pages, then pull out the updated date from there. Try something like this.
Then, you can use the
$recently_updated_posts
in the standard WordPress loop and have access tothe_modified_date()
and theget_the_modified_date()
functions.