Post Modified Date Shortcode for WordPress

Here’s a WordPress shortcode to get the post modified date:

Shortcode: [modified_date]

Code for the shortcode:

//Modified Date
function post_modified_date() {
    return get_the_modified_date();
}
add_shortcode( 'modified_date', 'post_modified_date' );
PHP

Wherever you want to display the post modified date, you can simply use the [modified_date] shortcode.

How to add this code to your WordPress site

Leave a Comment