Display Last Updated Date in Newspaper WordPress Theme


There are lots of tutorials available on how to display 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 last update 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

Display Last Updated Date in Newspaper WordPress Theme

Before Adding Last Modified Date
Before Adding Last Modified Date
  1. First of all go to wp-content/themes/Newspaper/includes/wp_booster/
  2. Now open td_module_single_base.php and find the code that looks like this. It will be around line #285.
     if (td_util::get_option('tds_p_show_date') != 'hide') {
                    $td_article_date_unix = get_the_time('U', $this->post->ID);
                    $buffy .= '<span class="td-post-date">';
                    $buffy .= '<time class="entry-date updated td-module-date' . $visibility_class . '" datetime="' . date(DATE_W3C, $td_article_date_unix) . '" >' . get_the_time(get_option('date_format'), $this->post->ID) . '</time>';
                    $buffy .= '</span>';
  3. Change Line #2 of the above code to
    $td_article_date_unix = get_the_modified_time('U', $this->post->ID);
  4. and Line #4 of the above code to
    $buffy .= 'Last Updated: <time class="entry-date updated td-module-date' . $visibility_class . '" datetime="' . date(DATE_W3C, $td_article_date_unix) . '" >' . get_the_modified_time(get_option('date_format'), $this->post->ID) . '</time>';
  5. Your code will look like this after updating
     if (td_util::get_option('tds_p_show_date') != 'hide') {
                    $td_article_date_unix = get_the_modified_time('U', $this->post->ID);
                    $buffy .= '<span class="td-post-date">';
                    $buffy .= 'Last Updated: <time class="entry-date updated td-module-date' . $visibility_class . '" datetime="' . date(DATE_W3C, $td_article_date_unix) . '" >' . get_the_modified_time(get_option('date_format'), $this->post->ID) . '</time>';
                    $buffy .= '</span>';
  6. You’ve successfully changed the post date to last updated date in all the posts. Now you have do the same for homepage.
    After Adding Last Modified Date
    After Adding Last Modified Date
  7. Now perform the same changes to td_module.php in the same folder.

What we just did?

  • td_module.php contains the general functions & code of the Newspaper theme. It is generally used by homepage.
  • td_module_single_base.php is almost same as td_module.php 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 Update Date?

  • As we know that google show 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 time stamp in the search result and also on the post.
  • The visitor will think that it may be an outdated article and will most probably will find other blogs or website.
  • Hence this may increase your CTR and reduce your Bounce Rate.
  • You can check out the image below. Although 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.

  • 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.

  • 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.

  • 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. 😀

  • 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

  • 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.

  • 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.

  • 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

    • Hello Hitesh,

      The path is same. However that was our mistake we forgot to add themes directory in the path. We have fixed that. Thanks for pointing that out.

      Now coming to your question. WordPress has a function called human_time_diff( get_the_time( ‘U’ ), current_time( ‘timestamp’ ) ).’ ‘.__( ‘ago’ ); to show that. You can implement it easily in the Newspaper theme. You can find more information here: https://codex.wordpress.org/Function_Reference/human_time_diff

  • 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.