I want to display “Last updated” date after content but before ‘next’ and ‘previous’ links. With the following code, utilizing the after_content hook, I get the last updated date displayed right below the ‘next’ and ‘previous’ links. I want the opposite.
<?php if ( is_single() ) {
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '<time class="last-updated" datetime="' . esc_attr( get_the_modified_date( 'c' ) ) . '" itemprop="dateModified">' . esc_html( get_the_modified_date() ) . '</time>';
echo 'Updated on ' . $time_string;
}
} ?>