How do I have both the creation date and modified at date together?

Posted in: Newspaper
Post count: 42

Hi,

I understand that I can’t have the “Created on” date together with the “modified on” date simultaneously on the post listing block (I am using Block 2 on the TagDiv editor).

I want it to appear such that he Created on date appears on all post listing, together with the modified on date, if the post has been edited before. If the post hasn’t been edited before, the listing should just show the Created on date.

I’ve added the Single Post Modified Date element on the single post template as well, but it shows the Modified date, even when the post has not been modified before. How can I make it appear only when the post has been modified?

Thank you.

Post count: 18283

Hello !

Unfortunately this option is not available with Newspaper Theme at the moment.

Thank you for your understanding !

Post count: 42

Hi, thanks for the reply.

Can you advise the PHP file in which Block 2 is rendered/stored? Can we implement this ourselves?

If not, any news on future updates that implements this? As this is quite crucial.

Post count: 18283

Hello !

At the moment this option is not possible. I have passed this suggestion to our developers.

Thank you for your understanding !

Post count: 42

Hi, I’ve added a custom code to functions.php to get the Last modified date if there is any. But it doesn’t seem to be working. The Updated date still shows if there isn’t any revisions. And even if there are revisions, the Last modified date does not update.

Using a plugin produces the same problem too.

It seems that it only happens to this theme. Can you please assist me with this, as I believe that this is a very basic/simple function which should have already been included in this theme.

My code:

function display_last_updated_date( $content ) {
$original_time = get_the_time(‘U’);
$modified_time = get_the_modified_time(‘U’);
if ($modified_time >= $original_time + 86400) {
$updated_time = get_the_modified_time(‘h:i a’);
$updated_day = get_the_modified_time(‘F jS, Y’);
$modified_content .= ‘<time class=”entry-date updated td-module-date”>’. $updated_day . ‘, ‘. $updated_time .'</time>’;
$modified_content .= $content;
return $modified_content;
}
return ”;

}
add_shortcode( ‘modified_date’, ‘display_last_updated_date’ );

Post count: 42

I realised that it is getting the Post template’s Modified date instead, and not the post’s.

Any methods I can use to get the post’s Modified date?

Post count: 18283

Hello !

Please note that your request is custom work based which is not covered by the Newspaper Theme support: https://forum.tagdiv.com/newspaper-theme-support/

Thank you !

Viewing 7 posts - 1 through 7 (of 7 total)
The forum ‘Newspaper’ is closed to new topics and replies.