The newspaper theme by tagDiv is one of the most popular WordPress themes till date. With over 133,415+ sales, NewsPaper theme flaunts 4.81 stars on Envato Market.
Newspaper theme by tagDiv shows the first published date on posts and home page by default. But have you ever wondered if you would be able to show the last updated date on the Newspaper theme?
Do not worry if you want to display the last updated or modified date on your posts in the Newspaper theme then you are at the right place.
Today in this guide we will learn to:
- Show last updated date on posts of Newspaper theme.
- Show last updated date on the home page & category pages of Newspaper theme
Table of Contents
Why show the last updated date on the Newspaper theme?
The newspaper theme by default shows the first published date. That means even if you update the posts time and again the published date won’t be updated, which I personally think is uncool.
Google and your audiences both love updated content and they should know that you have updated your content.
While searching queries in google you might have seen that published dates are shown below the title of the posts. Even you update the contents of your website time and again, Google will still show the old date (first published date) so, to remove this and flaunt your updated date you need to show the last updated date on your Newspaper theme.
If you want to get the last updated date on your WordPress posts powered by a newspaper theme then you need to make some tweaks to your newspaper theme files.
Before proceeding to the tutorial I want you to have your website’s complete backup because if you make certain errors while changing the theme files your website may break down. You may check our complete guide on taking WordPress website backup.
P.S: This tutorial is checked up to Newspaper 12.4. If you have a different version, the overall process will be the same but the codes might be at different lines.
So, let’s get started.
This tutorial will have two steps. One to show the last updated date on “Posts” and the other to show the last updated date on the “Homepage” or “Category Pages” of the newspaper theme.
1. Show last updated date on posts
In the first phase of this full tutorial, we will be editing a file called td_module_single_base.php. You can edit the the plugin files from your WordPress dashboard or you can edit them by going to you file manager through your hosting.
- From the left side of your WordPress dashboard go to Plugins >> Plugin Editor
- From the “Select plugin to edit” option select the “ tagDiv Composer” plugin.
- After that, from the plugin files go to legacy >> common >> wp_booster >> td_module_single_base.php
- Now, around the line 332 you will see some code like get_the_time(get_option(‘date_format’), $this->post->ID) . ‘</time>’;
- In the above code change the “get_the_time” tag to get_the_modified_time”.
- Now click “Update File“.
So, this is it. With this simple tweak on your td_module_single_base.php file you can successfully show the last updated date on your posts in the Newspaper theme.
2. Show the last updated date on the homepage.
The above-discussed method works inside the posts only, which means, you will see the last updated date only inside individual posts. You won’t see the last updated date on the home page or category pages for the same post.
So, if you want to show the last updated date on the homepage too, then you need to add this step additionally.
To show the last updated date on the homepage or the category pages of the newspaper theme, the steps are similar as above but the file we are going to edit will be different.
In the final phase of this tutorial, we are going to edit a file called td_module.php
- From the plugin files go to legacy >> common >> wp_booster >> td_module.php
- Now around the line 206 you will see similar code like $display_date = get_the_modified_time(get_option(‘date_format’), $this->post->ID);
- In the above code change the “get_the_time” tag to “get_the_modified_time”.
- Now, click “Update File“.
So, this is it. By tweaking the td_module.php file you can show the last updated date on the home page and category pages of the Newspaper theme.
Wrapping Up
In conclusion, to show the last updated date on the newspaper theme you need to follow a two-phased tutorial which includes changing theme files i.e. td_module_single_base.php and td_module.php. After, changing both the files step-by-step as above; you will have an updated date on your posts and home page in your newspaper theme.
If you have any further questions regarding this topic, feel free to ask me in the comment section and I will reply to you as soon as possible.
ATTENTION!
If you edit the theme files carelessly in the latest Newspaper theme it will prompt its popup on your website that will cover all your content which says “The newspaper theme license key is not registered on this website.” To remove thins you need to reset your newspaper license and again enter it from Newspaper >> System Status >> Registration Key.
Also Read:
How to show last updated date on GeneratePress theme
How to show Weather Forecast in Newspaper theme
FAQ’s
How do I show the modified date in a newspaper WordPress theme?
You can show the modified date in a newspaper WordPress theme by editing the “td_module_single_base.php” file inside the “tagDiv composer” plugin.
How do I show the last updated date of posts instead of published date?
To show the last updated date instead of the published date in the Newspaper theme you need to change the “get_the_time” tag to “get_the_modified_time” in the “td_module_single_base.php” file.
Hi there! Do you have updated instructions for how to update the date on posts for websites using Newspaper 11.5.1 themes? I tried this with my Newspaper theme and it unfortunately didn’t work. Thank you!
Hello Shani Whisonant!
I just tested on my another website which is using Newspaper 11.5.1 and this process works perfectly fine.
Please, go through the tutorial once again and let me know if you get stuck somewhere.