Last Updated date in Theme

Posted in: Newspaper
Post count: 20

HI,How can I display the “last updated date” in my post. Which theme file needs modification. Also whether Google will use this last updated date in their search results.

The code, I want to add is as below:
<?php $u_time = get_the_time(‘U’);
$u_modified_time = get_the_modified_time(‘U’);
if ($u_modified_time >= $u_time + 86400) {
echo “Last updated on “;
the_modified_time(‘F jS, Y’);
echo “, “; }
else {echo “Posted on “; the_time(‘F jS, Y’);} ?>

Post count: 18283

Hello !

You can add the last modified date when using a single post template from the cloud library and insert the element using the tagdiv composer.

Find out more about it here: https://forum.tagdiv.com/design-post-pages-using-cloud-library-templates/

Thank you !

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