Custom Avatar not showing up (8 posts)

  1. bekar09
    Posted 3 years ago #

    I am using a custom function for avatar (code pasted below). I currently am developing on a local setup. The problem that I'm facing is that the image is not showing up on the Discussion settings page as well as on the actual comments section of a post.

    When I looked at the image source, I find that it is "http://i1.wp.com/localhost/wordpress/wp-content/themes/test_theme/images/default_avatar.png". The same thing is happening when I use the blank gravatar "http://i0.wp.com/localhost/wordpress/wp-includes/images/blank.gif".

    I tried to echo the $myavatar in the below snippet and it prints the correct image source. How and why does wordpress link to *.wp.com/*?

    add_filter( 'avatar_defaults', 'custom_avatar' );
    function custom_avatar ($avatar_defaults) {
      $myavatar = get_stylesheet_directory_uri() . '/images/default_avatar.png';
      $avatar_defaults[$myavatar] = "Custom Avatar";
      return $avatar_defaults;
  2. ricardusexa
    Posted 3 years ago #

    Just use gravatar.

  3. bekar09
    Posted 3 years ago #

    I don't want to use gravatar as the default avatar service. This code used to work for me but not anymore. Otto or somebody else have any clue as to whats happening?

  4. bekar09
    Posted 3 years ago #

    Does anyone face this issue with Genesis theme framework? I mean this used to work well with Thesis theme framework.

  5. istef8
    Posted 3 years ago #

    Hi Bekar,
    I have the exact same problem here... and it's driving me nuts! LOooOOL ;-)

    I get a slightly different address for my image though..

    Very strange...
    Any ideas, anyone ?

  6. bekar09
    Posted 3 years ago #

    I am still breaking my head for this. any clue whats going on?

  7. Michael Ott
    Posted 3 years ago #

    Just looking into this today, it appears a change was made at Gravatars end that is causing the problem:


    ...and there is a support ticket in place for it:


    Pretty annoying.

  8. wahmaholic
    Posted 2 years ago #

    It seems Gravatar still hasn't addressed this problem. A quick workaround is to rename your gravatar image, update your functions.php to reflect the new name, and the avatar will appear as it should :)

Topic Closed

This topic has been closed to new replies.

About this Topic