OceanWP is one of the most flexible themes for WordPress. You can use it for blogs, e-commerce sites or websites.
While you can almost change everything to your liking, there is no way to show the modified date(when the page/post was last updated) instead of Published date.
You can hide the published date but can’t replace it with the modified date.
Or can you?
In this tutorial, you will learn how to show Last Updated/Modified Date instead of Published Date in OceanWP.
Why Would You Want to Display Modified Date?
There’s a simple answer to that.
The published date is the date when your post was published.
Imagine you published your post 1 year ago but updated it yesterday.
What will your readers see?
They will see the published date and think that it’s outdated. Even though you updated it yesterday.
Everyone wants to read fresh content. People may reject your content just because it displays the published date instead of last modified date.
How to Display Last Modified Date in OceanWP:
The method that I’m going to show you will replace the published date. It won’t add any extra line below the meta info like the modified date plugin.
Caution: This method involves a tiny bit of theme code editing. Pay attention while you follow the steps and don’t screw up. And of course, back up your site.
1. Head over to Theme Editor(Appearance>Theme Editor)
2. Navigate to partials/single/meta.php
3. Now change the get_the-published_date() to get_the modified_date(). Your theme code will look like this:
If you aren’t using a child theme the changes will be lost on theme update. So use a child theme or remember to change the code after every update.