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

Leave a Reply
You must be logged in to post a comment.