Home LearnWordPress how to put last updated date on your post

WordPress how to put last updated date on your post

by Thando Gama
how to put last updated date on your WordPress post 2020
Spread the love

WordPress how to put last updated date on your post. In the video below we show step by step on how to add that code to your theme functions.php page.

https://www.youtube.com/watch?v=v1EfeD_o1NU

Here are the codes below jut copy them the way they are and paste them in your functions.php but for the theme .

/* this code goes at the end of the functions page */
function wpp_updated_date( $content ) {
$published_date = get_the_time(‘U’);
$modified_date = get_the_modified_time(‘U’);
if ($modified_date >= $published_date + 86400) {
$updated_date = get_the_modified_time(‘jS M, Y’);
$show_updated_date .= ‘

LatUpdated On — ‘. $updated_date .”;
}

$show_updated_date .= $content;
return $show_updated_date;
}
add_filter( ‘the_content’, ‘wpp_updated_date’ );

Related Articles

Leave a Comment