Show Last Modified Date and Post Date in WordPress

Add Tool

Show Last Modified Date and Post Date in WordPress


Show Last Modified Date and Post Date in WordPress

If you regularly update your blog posts, then why not show last modified date and post date in WordPress post page to let readers know when the post was last updated.

Use this below code to display the last modified date if the post has been modified at a later date.

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 ". "; } ?>

If you think the above codes is large you can use only the below code to display publish date and last modified date

<strong>Publish:</strong> <?php the_time('M jS, Y g:i A'); ?>
<strong>Update:</strong> <?php the_modified_date('M jS, Y g:i A'); ?>

Here <?php the_time('M jS, Y g:i A'); ?> will display publish date and

<?php the_modified_date('M jS, Y g:i A'); ?> will display Modified date.

Don't forget to add this code within WordPress loop


Tags: Show Last Modified Date and Post Date in WordPress, WordPress, WordPress Hacks, WordPress How-To, WordPress loop, post date in WordPress, last modified date, last update
Payza

About Masum Billah

Show Last Modified Date and Post Date in WordPress 1stWebSuite website seo tool is a free website ranking tool site provides a lot of on page and off page seo useful tools for you. On this site, we have a large number of website ranking tools


SIGN UP TO GET UPDATE TO YOUR INBOX




Discuss about: Show Last Modified Date and Post Date in WordPress


adf.ly