Support » Fixing WordPress » Custom Avatar not showing up

  • Hi,
    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 “”. The same thing is happening when I use the blank gravatar “”.

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

    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;
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Custom Avatar not showing up’ is closed to new replies.