WordPress.org

Ready to get started?Download WordPress

Forums

Custom Avatar not showing up (8 posts)

  1. bekar09
    Member
    Posted 1 year ago #

    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;
    }
  2. ricardusexa
    Member
    Posted 1 year ago #

    Just use gravatar.

  3. bekar09
    Member
    Posted 1 year 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
    Member
    Posted 1 year ago #

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

  5. istef8
    Member
    Posted 1 year 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..
    http://i0.wp.com/localhost.....

    Very strange...
    Any ideas, anyone ?

  6. bekar09
    Member
    Posted 1 year ago #

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

  7. Michael Ott
    Member
    Posted 1 year ago #

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

    http://buddypress.org/support/topic/what-is-i0-wp-com/

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

    http://buddypress.trac.wordpress.org/ticket/4571

    Pretty annoying.

  8. wahmaholic
    Member
    Posted 1 year 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