Custom Gravatar not working.
-
I tried this is functions.php `
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/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;
}`And in my comments.php I have `<?php
if (function_exists(‘get_avatar’)) {
echo get_avatar($comment, $size = ’56’);
}
?>`But the custom avatar will not show. What I get instead is an image placeholder with the link
https://1.gravatar.com/avatar/d34b49e186db2b0bc1016f9fc0004195?s=56&d=http%3A%2F%2F192.168.1.100%2Fwp-content%2Fthemes%2Fhannawerner.com_2%2Fimages%2Favatar.png%3Fs%3D56&r=G
Does anyone know what I’m doing wrong?
- The topic ‘Custom Gravatar not working.’ is closed to new replies.