• Resolved Maggie96

    (@maggie96)


    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]

Viewing 1 replies (of 1 total)
  • Thread Starter Maggie96

    (@maggie96)

    Ignore this request – I got the answer from the WordPress forums. ??

    • This reply was modified 7 years, 4 months ago by Maggie96.
Viewing 1 replies (of 1 total)
  • The topic ‘Remove time (hours-minutes) from Last Updated Date’ is closed to new replies.