• Resolved David Borrink

    (@davidborrink)


    I used the following code from the codex to add a new default gravitar to a site, but something’s amiss.

    Here’s the code from the codex…

    add_filter( 'avatar_defaults', 'new_default_avatar' );
    
    function new_default_avatar ( $avatar_defaults ) {
    		//Set the URL where the image file for your avatar is located
    		$new_avatar_url = get_bloginfo( 'template_directory' ) . '/images/new_default_avatar.png';
    		//Set the text that will appear to the right of your avatar in Settings>>Discussion
    		$avatar_defaults[$new_avatar_url] = 'Your New Default Avatar';
    		return $avatar_defaults;
    }

    I put my new avatar in the images folder just like the code above describes and I’ve rechecked my file name a few times. My code editor verifies the image in my source file so I know it’s a proper file and it’s there.

    Any ideas why my gravitar isn’t showing. I get a blank space. The choice for my gravitar does show up in the dashboard in Settings > Discussion, but with no icon, either. I have verified that the image IS in the images folder via FTP.

    The only other clue is that when I click on the image, I do get a white screen with this note: “We cannot complete this request, remote data was invalid”. I did a search on that one, and there’s a lot of info about Jetpack and Photon, but I’m using neither on my site.

    So, I’m stumped.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Site URL Please?

    Thread Starter David Borrink

    (@davidborrink)

    Here’s the link.

    Ok this is how I see the home page: https://screencast.com/t/1xJSPLaQ55hx

    Thread Starter David Borrink

    (@davidborrink)

    Yes, but my question is about the gravitars in blog comments.

    Thread Starter David Borrink

    (@davidborrink)

    I’ve tried two different code examples from other blogs and basically it’s the same setup but with different function names. Each time the new choice shows up in Settings > General but without an image. It shows that I have chose the new default image, but they are not showing up on my pages. Regular Gravitars do show up, but my new default gravitar is not working.

    I’m working on a Twenty Twelve child theme and I’ve also switched “template_directory” to “stylesheet_directory” per two notes on one of the examples.

    So I remain stumped.

    Thread Starter David Borrink

    (@davidborrink)

    Okay, I got it to work.

    1. I had the file too big apparently. It was 121×121 to start and my guess is that was too big. I changed to 64×64.

    2. I resaved it as a PNG file instead of a JPG.

    So one of those changes, or both, helped.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Custom gravitar not showing up in dashboard or on comments’ is closed to new replies.