Changing default (GR)avatar on comments by unregistered visitors (2 posts)

  1. OliveStreet
    Posted 3 years ago #

    So apologize upfront for asking something that has been asked and answered a million times already. Also, it probably wouldn't be worth your time to leave a snide remark. If you've got an idea which might help me, great: I'm all ears.

    After a day and a half of searching, here's where I'm at: I have the following snippet php placed at the end of my functions file,

    add_filter( 'avatar_defaults', 'newgravatar' );
    function newgravatar ($avatar_defaults) {
    $myavatar = get_bloginfo('template_directory') . '/images/yournewgravatar.jpg';
    $avatar_defaults[$myavatar] = "Your New Gravatar";
    return $avatar_defaults;

    I've also installed the Avatars plugin, version 10.5 by Peter Sterling.

    Now when I leave a comment, logged in as the admin, my avatar (the one you can see here) shows up in the comments ... This is because I am registered. And this is exactly what I want when I respond to posts.

    But when I leave a comment using a different browser – that is, simulating a comment left by an unregistered guest – the avatar that shows up is the vertically aligned blue and white Gravatar "G". That's not what I want. For anyone beside me leaving a comment, I would like my company logo to show up as the avatar.

    I really don't want people to upload their own avatars, but if they're registered with Gravatar and have one that follows them around, that's okay.

    Inside Discussions I can see my company logo/avatar and I can even select it with the radio button. However, the "G" continues to show up as the default for non-registered guest leaving a comment.

    Inside the settings for Avatars, I also have my company logo set as default, but still the G.

    So for the moment my only two choices for non--registered guests leaving a comment are the G or no avatar at all.

    I have tried this using the php code above by itself, as well as different variations of that same function I've found searching various tutorials. And I've also deleted the function and just tried using the Avatars plugin. But neither seems to do exactly what I want.

    So please, if you can see what I am missing, I would be humbly grateful to you if you could point it out to me. This is very frustrating.

    Thank you!

  2. OliveStreet
    Posted 3 years ago #

    I figured it out.

Topic Closed

This topic has been closed to new replies.

About this Topic