Add Last Modified Date to Post Byline

For some articles or older blog posts, you may want to show the date of the last time it was edited to show your readers that the information is up-to-date and still relevant for today.

By adding this simple function to your child theme’s functions.php, you can automatically publish the last time the article in question was updated with no extra effort:

Byline Last modified date WordPress
function md_child_theme_byline_date() { ?>

	<span class="byline-date-modified byline-item">
		<i class="byline-item-icon md-icon-clock"></i> <?php _e( 'Last updated:', 'md-child-theme' ); ?> <?php the_modified_date(); ?>

<?php }

add_action( 'md_hook_byline_bottom', 'md_child_theme_byline_date' );

Leave a Comment