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 “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;
    }
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.