Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function display_last_updated_date( $content ) {
- $original_time = get_the_time('U');
- $modified_time = get_the_modified_time('U');
- if ($modified_time >= $original_time + 86400) {
- $updated_time = get_the_modified_time('h:i a');
- $updated_day = get_the_modified_time('F jS, Y');
- $modified_content .= '<p class="last-modified">This post was last updated on '. $updated_day . ' at '. $updated_time .'</p>';
- }
- $modified_content .= $content;
- return $modified_content;
- }
- add_filter( 'the_content', 'display_last_updated_date' );
Add Comment
Please, Sign In to add comment