You must create a Child Theme for this.
After creating the Child Theme, paste this code in the functions.php
file with NO space underneath the last line of code and NO closing tag “?>
“.
if( ! function_exists('show_avatars') ) {
add_filter('pre_option_show_avatars', 'override_show_avatars');
function override_show_avatars() {
global $current_user;
if (current_user_can('administrator')) {
return false;
}
return $current_user->show_avatars;
}
}
This will disable the Avatars function in all users except the administrators of your site.
In the Child Theme style.css
, paste this code.
#comments .comment-author.vcard img {
display: none;
}
This will hide the avatars in the comments for everyone including admins and the public.
I have tested this in my development site and it works.
Any issues, let me know.