How to show "Page last updated" in site? (3 posts)

  1. azarmig
    Posted 7 years ago #

    I am trying to show my users what time and/or date the site was last updated/edited.

    Is there a php code or plugin for that?

    I found this code:

    $last_modified = filemtime("example7.php3");
    print("Last Modified ");
    print(date("m/j/y h:i", $last_modified));

    Does this do my job?

  2. Joni
    Posted 7 years ago #

    It's going to be last modified basically as of the date of your last blog post. The content is what people care about when they want to know how "fresh" your site data is and most people know how to use an RSS feed.

  3. etegration1
    Posted 6 years ago #

    what are you trying to say joni? use the following, it will work.

    <?php $u_time = get_the_time('U');
    $u_modified_time = get_the_modified_time('U');
    if ($u_modified_time >= $u_time + 86400) {
    echo "and last modified on ";
    the_modified_time('F jS, Y');
    echo " at ";
    echo ", "; } ?>

    From http://systembash.com/content/last-modified-date-time-on-wordpress-template-page/

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.