Hi macanroe,
To show the avatar and username in the article detail, you can add the following code to the \templates\gk_news2\html\com_content\article\default.php file, line 301.
<?php
$author_obj = JFactory::getUser($this->item->created_by);
$author_email = $author_obj->email;
$author_name = $author_obj->name; // Get the full name
// Generate the Gravatar URL
$avatar_hash = md5(strtolower(trim($author_email)));
$avatar_size = 120;
$default_image = 'https://example.com/default-avatar.jpg'; // URL to your default image
$avatar_url = 'https://www.gravatar.com/avatar/'.$avatar_hash.'.jpg';
$avatar_url .= '?s='.$avatar_size;
$avatar_url .= '&d='.urlencode($default_image);
// Construct the profile URL
$profile_url = JRoute::_('index.php?option=com_users&view=profile&user_id=' . $author_obj->id);
echo '<img src="'.$avatar_url.'" alt="" />';
echo '<p><a href="'.htmlspecialchars($profile_url, ENT_QUOTES, 'UTF-8').'">'.htmlspecialchars($author_name, ENT_QUOTES, 'UTF-8').'</a></p>';
?>
The default.php file:
Note: To use the code for retrieving a Gravatar, please ensure you have uploaded your desired image to Gravatar using the following link.