HomeBusinessWordPressHow to Display Last Updated Date in Newspaper WordPress Theme

How to Display Last Updated Date in Newspaper WordPress Theme


“As an Amazon Associate & Affiliate Partners of several other brands we earn from qualifying purchases.” [Read More Here]


There are lots of tutorials available on how to display the last updated/modified date in WordPress. These are basically general tutorials which you can apply to several themes. However, there are some themes in which it’s hard to find where to make modifications to show the last updated date. We also encountered the same problem in Newspaper WordPress theme but luckily after messing around with the code, finally we’ve found a solution. So here’s what to do:

Also read: Find Competitors Organic Keywords for Free

Steps to Display Last Updated Date in Newspaper WordPress Theme

Before Adding Last Modified Date
Before Adding Last Modified Date

Recently Tagdiv had to change the whole structure of the theme to comply with the new standards for WordPress Themes enforce by Envato. In doing so they have to keep just the basic functionality of the theme in the code and allow other heavy files to load from plugins if activated by the users.

Hence the file structure changed for the newer version of Newspaper Theme. We have two files that we need to edit to show the last updated date on the homepage as well as post. And further down this post, we will refer them as File 1 & File 2.

Select the Appropriate Version & Proceed:

For Newspaper Theme 9.7 or Newer

File 1: wp-content/plugins/td-composer/legacy/common/wp_booster/td_module_single_base.php
File 2: wp-content/plugins/td-composer/legacy/common/wp_booster/td_module.php

For Newspaper Theme 9.6.1 or Older

File 1: wp-content/themes/Newspaper/includes/wp_booster/td_module_single_base.php
File 2: wp-content/themes/Newspaper/includes/wp_booster/td_module.php

  1. Open File 1 and find the code that looks like this.

    $td_article_date_unix = get_the_time(‘U’, $this->post->ID);

    AND

    $buffy .= ” . get_the_time(get_option(‘date_format’), $this->post->ID) . ”;
  2. Change the highlighted get_the_time function to get_the_modified_time.
  3. Pretty Easy, HUH! You’ve successfully changed the post date to last updated date in all the posts.
  4. Now repeat the step for File 2 and you’ll be able to see the last updated date on the Homepage too.
After Adding Last Modified Date
After Adding Last Modified Date

What We Just Did?

  • File 2 contains the general functions & code of the Newspaper theme. It is generally used by the homepage.
  • File 1 is almost the same as File 2 however it contains general functions & code for post page.
  • We basically changed the get_the_time() function to get_the_modified_time(). You can read more about these functions on WordPress Documentation.

What are the Benefits of Showing Last Updated Date?

  • As we know that Google shows the date of the articles in the search result.
  • Suppose you have written an article about two years ago.
  • But when you update your article, still it will show the same timestamp in the search result and also on the post.
  • The visitor will think that it may be an outdated article and will most probably find other blogs or website.
  • Hence this may increase your CTR and reduce your Bounce Rate.
  • You can check out the image below. Although the article was posted on 16 February 2015. After updating the article, the date changed to 21 August 2016.
Google Search Results Shows Last Updated Date
Google Search Results Shows Last Updated Date

We hope that this article helped you in customizing your theme to show the last modified date on Newspaper theme. If you have any doubts or problems you can throw it in the comment section below.

Ezoic Banner

About Author

Mehul Borichahttps://techrrival.com
Mehul Boricha is the founder of Tech Arrival & Astute Links. He is a computer and smartphone geek from Junagadh, Gujarat, India. He is a Computer Engineer by Education & an Entrepreneur by Passion. Apart from technology geek, he is an audiophile & loves to connect with people.

39 COMMENTS

  1. Hey Mehul, the article is great, I used to fix the last updated in my site. However please note that you need to edit the td_module.php file only and it works like a charm.

  2. Hi Mehul,
    Thanks for such a nice article. The code worked for me like a charm. But I have a question what if we update the theme. I think it will be overwritten.
    Can you give a code for functions.php so that modifications cab be save and are not affected with updating.

    • Hello Manpreet,

      We will try to create such code, but for now you will have to go with this method. We will notify you once we get some success in doing so.

  3. Hai mehul,

    Can you help me, how to show date like 09:12 in every post in homepage and single post? I use newspaper theme too. Thanks a lot.

    • You can do it by modifying that code as per your requirement. I am not able to understand you properly what you are saying but we can solve it over skype: boricha.mehul5. Feel free to connect with me anytime. 😀

  4. Hello Mehul,
    I used This code before 2 3 times of different version of newspaper theme. It Perfectly works for me.
    But, This code is not working with the latest update of newspaper theme on 28
    any alternate way to modify this date

  5. Hello Buddy its working fine for me.
    I think that time something wrong with this but its working now like before. Thanks for Sharing this Article and thanks for reply.

  6. HI !!! Mehul Boricha
    I WANT DISPLAY TIME ONLY IN THE PLACE OF DATE AND TIME…how can i do it..am i trying so many times and i didnt get..

    • It is working dear. You just have to follow the steps properly. You can see we are using Newspaper theme with last updated date. That is the best proof of this post.

  7. Hello Mehul, I thank you for this wonderful code. But i am using Newspaper theme version 9. In which the wp-Booster folder has been shifted from wp-content/Newspaper/includes/wp_booster/ TO wp-content/themes/Newspaper/includes/wp_booster/.

    This is working great on Newspaper 9.0.1

    My query to you Mehul is, can you help me display “XX days ago” on the Blocks & Big Grids of Newspaper Theme.

    I mean all the posts that are not older than 1 hr, I want it to display as “xx mins ago”
    And all the posts that are not older than 24 hours, I want it to display as “xx hours ago”

    Mehul Bhai, can you please take out some time and help us all achieve this goal.

    Thanks & Regards

  8. How can add date to the pages and I want to update those pages date too? My website has lots of pages. So I need to know this. Any help will be appreciated.

    • Hello Mehed,

      Though I am not 100% sure but you will have to edit page.php inside the theme. You can get an idea what to put there from the formatting of loop-single.php. Let me know if you need anything else.

      • How can do it for pages?
        By defaul this theme does not date option.
        First, I want to add date.
        After that I want to add “Last Updated/Modified Date” code.

        How I can do that?

        • Hello,

          I don’t know how to do that because pages are not supposed to have these options. Will let you know if we find any method to get it done.

          BTW why do you want to add the date on Pages? Why simply not use the post option?

Leave a Comment

Please enter your comment!
Please enter your name here

By submitting the above comment form, you agree to our Privacy Policy and agree with the storage and handling of your data by this website.

Stay Connected

Subscribe to our Newsletter

Stay updated with all the latest news, offers and special announcements.

By signing up, you agree to our Privacy Policy and agree with the storage and handling of your data by this website.

Latest Posts

11 Best Free CAD Software You Should Use

CAD is short for computer-aided design. It is a highly useful software that is used for technical illustrations and product designing. From small businesses...

11 Best Procreate Alternatives for Android

With the increasing popularity of digital art, the demand for painting and sketching apps has also increased. You can find an array of apps...

8 Best Music Recognition Apps To Identify Songs By Tune

So you have heard a catchy song in reels, but you cannot find out what song it is. Feels frustrating, right? Well, we have...

The Future of Artificial Intelligence in the Automotive Industry

Back when the first three-wheeler and four-wheeler motor vehicles were invented in the 1800s, every stage of production was handled by humans. From assembling...

15 Best Free YouTube to MP3 Converter & Downloader Apps

Most people want their favorite tunes stored on their smartphones, iPods, or computer so that they can access them offline at any given time....

All Time Favorites

18 Best WiFi Hacking Apps for Android

When you enter the hacking world, you would know that almost every basic tutorial you would search for on the net won’t be possible...

21 Best Android Apps Not on Google Play Store

Google Play Store has the most extensive collection of apps for Android. Almost everyone downloads apps from the Play Store. But many excellent apps...

14 Best Game Hacker Apps for Android (With/Without Root)

Are you a mobile gamer? If you are, then you've come to the right place. In this post, we are going to tell you...

How to Download Torrent Files with IDM (Torrent to IDM)

Hey guys, you may all have heard about different ways to download torrent files. And some of you may also have downloaded them using...

11 Best Download Managers for Windows

The Internet is a vast resource of a lot of things which includes music, videos, movies and a lot of other things. The ability...