Topical content is inherently only relevant for a short period of time. Using evergreen content will keep your readers interested and engaged and should never lose relevance. One way to keep your content evergreen is to periodically update your website as information changes. But how will the reader know when an article was last modified? This tutorial will show you how to display the last updated date for The7 theme posts in WordPress.
Step 1: Use The7 Theme Filter presscore_posted_on_parts
You may have seen several tutorials that use the_content filter to add the Last Updated Date to the post. You may have also seen tutorials that suggest editing theme template files. Fortunately, The7 theme allows us to use the presscore_posted_on_parts filter to add the Last Updated Date (Last Modified Date) to the Post Meta Data Section without any template customization.
Copy and paste the below code snippet into your child theme’s functions.php file. Line 16 can be used to show the Last Updated Date and Last Updated TIme of the post.
Step 2: Style Using CSS
The next step is to copy and paste the code below into the style.css file located in your child theme’s directory. The CSS in the below code snippet will change the font color to grey and remove the underline.
Final Thoughts: You Should Display the Post Last Updated Date for Evergreen Content
Take a look at the article on WP Beginner if you aren’t using The7 theme and want to add the Last Updated Date and Last Updated Time to your website. These two code snippets are written to work with The7 theme only. If you decide to use the code snippets for another theme, keep in mind that the presscore_posted_on_parts filter will not be usable, you will have to rewrite some of the PHP, and you will have to use another filter.
The WordPress plugin WP Last Modified Info will allow you to display the Last Modified date on your website, and also offers many more useful features.
For more information about The7 theme:
Need help? Our WordPress Development Service is a comprehensive solution for small, medium and enterprise-level businesses. Call us at 602-633-4758 for a free consultation.