Embed last modified date

Sometimes a WordPress page needs to be updated often. It might be useful for these pages to display the last modification date.

Add the code below to the current theme’s functions.php (or to your functionality plugin). Then you can include the [modified] shortcode within the page content to display the date the page was last modified.

// ==============================================
//       SHORTCODE FOR LAST MODIFIED
// ==============================================

function cc_last_modified() {
	return '<div class="modified">Last modified: ';
	return get_the_modified_date();
	return '</div>';
}

add_shortcode('modified', 'cc_last_modified');