Hi guys.
I would like to share this feature for those who want to show the published and modified date of a post with a condition.
add_filter( 'generate_post_date_output','aa_add_to_post_date' );
function aa_add_to_post_date( $output ) {
$published = get_the_date();
$modified = get_the_modified_date();
if ($published == $modified){
return 'Published on ' . $output;
} else {
return 'Published on ' . $output . '· Updated on '.$modified;
}
}
Have a nice day,
Alessio