Function for Showing post date and the last modified date on wordpress site

Following snippet that will display the last modified date with your post along with the date posted as long as the dates are not the same.

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

Related posts:

HTML5 page structure

HTML5 offers more powerful structure comparing to older versions of Html. There are many new …


Partner with Us

We are providing an exclusive partnership offer to individuals and companies who are interested in setting up their own web design & development company. For more information about how to partner with us, please contact us