Default Avatar Change

  • Chris



    I’m trying to set my site logo as the default avatar when a commenter does not have a gravatar account. I don’t like the ugly ones that WP provides. I have looked online at a couple sites that give the same code to use, and it seems to work well with everyone else, but not me. Does graphene handle gravatars differently for some reason?

    Here is what I am using, and although the name of my new default avatar shows up in the Settings –> Discussion section when I go to select it as default, the logo doesn’t show up there, nor on a test comment with a fake e-mail.

    //***Custom Gravatar**/
    add_filter( 'avatar_defaults', 'bourncreative_custom_gravatar' );
    function bourncreative_custom_gravatar ($avatar_defaults) {
    $myavatar = get_stylesheet_directory_uri() . '/images/defaultGravatar.png';
    $avatar_defaults[$myavatar] = "Made Worthy";
    return $avatar_defaults;

    Does anyone see anything wrong?




    Try using get_bloginfo('stylesheet_directory') instead of get_stylesheet_directory_uri()



    You know what…I was doing this with a test site on my WAMP server. When I put it live, it worked like a charm. Thanks for chiming in though. I do appreciate it.

Viewing 3 posts - 1 through 3 (of 3 total)

  • You must be logged in to reply to this topic.