Articles of gravatar

Replace default avatar

I’ve searched google quite a bit and every site has the same filter but it doesn’t seem to be working for me. Not sure if it’s my setup or just old code. I’m trying this: add_filter( ‘avatar_defaults’, ‘newgravatar’ ); function newgravatar ($avatar_defaults) { $myavatar = get_bloginfo(‘template_directory’) . ‘/img/blog_noPhoto.jpg’; $avatar_defaults[$myavatar] = “Default Avatar”; return $avatar_defaults; } […]

Use local image for default avatar

I tried putting this snippet in my functions.php add_filter( ‘avatar_defaults’, ‘newgravatar’ ); function newgravatar ($avatar_defaults) { $myavatar = get_bloginfo(‘template_directory’) . ‘/images/default_avatar.png’; $avatar_defaults[$myavatar] = “Locale”; return $avatar_defaults; } A new avatar appears in Options-Discussion. Problem is it’s not local at all.. the avatar is taken from http://i1.wp.com/mydomain.com/wp-content/themes/mytheme/images/default_avatar.png. So it passes through i1.wp.com anyway.. how can I […]

Use Gravatar as fallback image if no local image is not found

I have been trying to use Gravator’s Identicon as the fallback image, is there is no image for a given user in a predefined image folder. consider the following scenario; User email : asd@asd.com an image is uploaded to wp-content/images/users/ with the file name 0eb178cec364c022a189c3814e5f7483.jpg (The file name is generated with md5(“asd@asd.com”.”customkey”);) If an imaage […]

Cannot get local avatars to show

See updates below. I upgraded to 3.7.1 using svn. I did this on my localhost first to make sure everything is fine. Everything was, so I proceeded to do it on the server. However, on the server, the users’ avatars are not showing up and instead everyone is getting Gravatar’s mystery man. Here is the […]

Alternative default avatar generator?

Most of the commenters at my WordPress blog do not have a Gravatar account. Hence the comment section is almost always filled with the same old mystery man avatars. I am looking for custom gravatar generators for commenters without their own avatar. So far I have only found Identicons, MonsterID’s, and Wavatars. I find some […]

Add gravatar to author list

I am using this code for listing out all authors on the site in my sidebar. It works, except I also need to pull in their Gravatar image. It’s working in a loop on the homepage with this <?php echo get_avatar( get_the_author_email(), ’80’ ); ?> but is there a way I can add it to […]

get_avatar() default image not working as of wp 3.5

As of upgrading to wp 3.5 the get_avatar function started not pulling in my default backup image. This has worked for many years this way and curious to why it would stop. I am using the normal use of the function as this: the $url value is the correct path to my default image found […]

Get users only if Gravatar is specified

I would like to retrieve a list of 12 WordPress users, but I would like to have them randomly (at each page reload) AND only 12 users that have a Gravatar specified. Right now, I have my 12 random users, but I can’t only retrieve those with a Gravatar… Could you help me ? Here […]

Filtering the default avatar list

I’m using the avatar_defaults filter hook to filter the default avatar list. For example: function my_avatar_defaults( $avatar_defaults ) { $avatar_defaults[‘http://example.com/foo.png’] = __( ‘Foo’ ); return $avatar_defaults; } add_filter( ‘avatar_defaults’, ‘my_avatar_defaults’ ); This works because if I visit Settings > Discussion and then scroll down, I can see Foo has been added as a default avatar […]

Replace Gravatar with img URL for avatars

I have many, many WordPress authors. For each, I have used the custom wp_usermeta profile field “photo_url” to store URLs for different remotely-hosted avatar images. I am currently displaying these image avatars on author.php by echoing the strings through the img HTML tag. But I’d like to more closely integrate them with WordPress, by making […]