Inspiration For Creative Minds
Home » Labs » Function for Showing post date and the last modified date on wordpress site  

Filed under Labs

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 ". "; 
          } 
?>
It's only fair to share...Share on Google+Tweet about this on TwitterShare on Facebook
Labs

Posts you may like: