How to Show the Last Updated Date for Posts in WordPress Newspaper theme [Updated]

Recently, Newspaper WordPress theme has been updated to move all the functionality previously part of the theme into the tagDiv Composer page builder. Due to this change, the child theme will no longer work because you cannot alter the files in a plugin with a child theme.

In addition, the existing method to change the post date to the modified date without using tagDiv Cloud Library in my previous post will not work any longer.

There are two options to show the last updated date for posts in Newspaper:

  • Using tagDiv Cloud Library
  • Modify a file under the tagDiv Composer page builder plugin

If you do not want to modify the post date, you can edit the following file for the default post template:

  • /wp-content/plugins/td-composer/legacy/Newspaper/loop-single.php

For the other default styles, you need to edit the following file:

  • /wp-content/plugins/td-composer/legacy/Newspaper/parts/header/header-style-1.php ~ header-style-12.php

For the default post template, search for the following line in loop-single.php:

<?php $td_mod_single->show_date(false) ?>

Replace it with the following:

<!-- date -->                    <span class="td-post-date">                       Last Updated: <time class="entry-date updated td-module-date" datetime="<?php echo esc_html(date(DATE_W3C, get_the_modified_time('U'))) ?>" ><?php the_modified_date(get_option('date_format')) ?></time>                    </span>

Now, the modified post date will be displayed for single posts.

WordPress Newspaper - Add Last Updated date

I requested the theme developer to add an option to show/hide the last updated date for single posts. I hope this option will be added in Theme Options in the near future.

For your references, some themes including Jupiter are on sale for celebrating Web Designer Day. Please refer to this page for the complete list of the themes.

See Also...