WordPress Show Last modified Date-Time

WordPress Show Last Modified Date-Time

 

WordPress Show Last modified Date-Time: If you have WordPress blog and want to show last updated date and time on your blog post, then you are on the right place and this article will help to achieve your goat.

 

We keep changing and updating the information on blog post as per the market requirement specially information related to email database,  navigation change in  tech tutorials post, old post which has got major changes in navigation and functionality.

 

In order to inform viewers we need to Show Last modified Date-Time in our wordpress blog post.

 

Please find the below steps to complete your requirement.

 

Steps to Show Last modified Date-Time in your WordPress post:

 

Step 1: Log In into your WordPress Website

 

Step 2: Navigate to Appearance – > Editor

 

Step 3: Click on Theme Function (function.php)

 

 

Wordpress Show Last modified Date-Time

 

Note: For Safe side take a backup of your code into notepad to avoid any code mess-up. Click anywhere in the code and select (CTRL+A) then copy (CTRL+C) and Paste (CTRL+V) it in your notepad.

 

Step 4: Scroll Down till end of the code and give some extra space after hitting Enter Key

 

Step 5: Copy the below code and paste it after space

 

function et_last_modified_date_blog( $the_date ) {
    if ( 'post' === get_post_type() ) {
        $the_time = get_post_time( 'His' );
        $the_modified = get_post_modified_time( 'His' );
 
        $last_modified =  sprintf( __( 'Last updated %s', 'Divi' ), esc_html( get_post_modified_time( 'M j, Y \a\t g:iA' ) ) );
        $published =  sprintf( __( 'Published on %s', 'Divi' ), esc_html( get_post_time( 'M j, Y' ) ) );
 
        $date = $the_modified !== $the_time ? $last_modified . ' | ' .  $published : $published;
 
        return $date;
    }
}
add_action( 'get_the_date', 'et_last_modified_date_blog' );
add_action( 'get_the_time', 'et_last_modified_date_blog' );


 

Step 6: Click on Update File Button

 

And it’s Done

 

Wordpress Show Last modified Date-Time

 

Open any of your blog post and observe it.

 

Also Read: How to download YouTube videos easy and fast

 

Tag: wordpress last updated plugin, wordpress update post modified date, wordpress last modified date, display the last updated date of your posts in wordpress, last updated on, “last update on”,get the modified date wordpress, wordpress get modified date by id, How to Display when a Post was Last Updated in WordPress

 

Summary
Wordpress Show Last modified Date-Time
Article Name
WordPress Show Last modified Date-Time
Description
If you have WordPress blog and want to show last updated date and time on your blog post, then you are on the right place and this article will help to achieve your goat.
Author
Publisher Name
My Easy Tech Support
Publisher Logo

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: