除非我误解了您的问题,否则请在您的主题中使用自定义gravatar,并将下面的代码添加到您的函数中。php或自定义插件。
从中自定义要使用的标题和图像。请参见下面的屏幕截图以获取最终结果。
add_filter( \'avatar_defaults\', \'dev_designs_gravatar\' );
/**
* Display a custom Gravatar
*
* @param $avatar
* @return mixed
* @author Joe Dooley - hello@developingdesigns.com
*
*/
function dev_designs_gravatar( $avatar ) {
$custom_avatar = get_stylesheet_directory_uri() . \'/images/avatar_default.png\';
$avatar[ $custom_avatar ] = "Custom Gravatar";
return $avatar;
}
![See Custom Avatar in top right of the admin bar.](https://i.stack.imgur.com/vpGAA.png)
![Select new Custom Gravatar option to set default gravatar for theme.](https://i.stack.imgur.com/1vtrw.png)