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.
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.
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’ );
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?
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 !