functions.php ye aşağıdaki kod yazın
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' );style.css ye aşağıdaki kod yerleştirin
.last-updated {
font-size: small;
text-transform: uppercase;
background-color: #fffdd4;
}
Teşekkürler kod için peki şöyle bir sorum olacak makalenin oluşturma tarihine 86400 ekleyerek modifiye tarihi atıyor.. Bu 86400 değişken yapma şansımız varmı ? Yani rasgele 10-20 dk aralığında bir süre üretsin..