Remove time (hours-minutes) from Last Updated Date
-
Hi,
Ok – now I need to remove the time from the “Last Updated on” information at the top of blog posts. Only the date of the update should show, not the time the update was made.
We’re using the Virtue Child Theme. This is the code I entered into the functions.php file:
function wpb_last_updated_date( $content ) {
$u_time = get_the_time(‘U’);
$u_modified_time = get_the_modified_time(‘U’);
if ($u_modified_time >= $u_time + 86400) {
$updated_date = get_the_modified_time(‘F jS, Y’);
$updated_time = get_the_modified_time(‘h:i a’);
$custom_content .= ‘<p class=”last-updated”>Last updated on ‘. $updated_date . ‘ at ‘. $updated_time .'</p>’;
}$custom_content .= $content;
return $custom_content;
}
add_filter( ‘the_content’, ‘wpb_last_updated_date’ );I tried removing
-
$updated_time = get_the_modified_time(‘h:i a’);
but that didn’t work. I’m missing something. Is there a way to edit this code so it removes the hours-minutes from the post meta info but leaves the Last Update Date information in place?
Thank you ??
Meagan
The page I need help with: [log in to see the link]
- The topic ‘Remove time (hours-minutes) from Last Updated Date’ is closed to new replies.