How to show the author’s photo, name, and date of the publication and modification?
How to show the author’s photo in WordPress?
<?php
global $post;
// Get the author ID
$author_id = get_post_field('post_author' , $post->ID);
// Get the author image URL
$output = get_avatar_url($author_id);
// Display the author image
echo '<img src="'.$output.'"/>';
?>
How to show the author’s name and date in WordPress?
<span>
By: Prof. Fazal Rehman Shamil </span>
<?php
$u_time = get_the_time('U');
$u_modified_time = get_the_modified_time('U');
if ($u_modified_time >= $u_time + 86400) {
echo "Last modified on ";
the_modified_time('F jS, Y');
}