WordPress how to put last updated date on your post

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.

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’ );

Thando Gama

Leave a Reply

Your email address will not be published. Required fields are marked *

Currently you have JavaScript disabled. In order to post comments, please make sure JavaScript and Cookies are enabled, and reload the page. Click here for instructions on how to enable JavaScript in your browser.

Next Post

Can Memelodi Sundowns break the bank and sign Cristiano Ronaldo?

Tue Aug 11 , 2020
Spread the loveCan Memelodi Sundowns break the bank and sign Cristiano Ronaldo? It is  true that Rristiano Ronaldo wants to leave juventus and go join another team and also challenge himself for new achievements. The 35 year old is one of the players who is known for being brave and […]