Skip to main content

Questions tagged [gravatar]

Gravatar is the default avatar service for WordPress. Depending on the theme users and visitors who have registered with gravatar will see their avatar when they, for instance, leave a comment.

Filter by
Sorted by
Tagged with
1 vote
1 answer
32 views

How to load locally saved author photos based on author ID

I'm looking for a way to allow the author photo to be shown without the author having a gravatar account. It seems this should be based on author id rather than email. Basically I just want to be able ...
Mikedefieslife's user avatar
0 votes
0 answers
149 views

How to add avatar to authors list?

I have code that shows authors list: <?php wp_list_authors( 'exclude_admin=0&optioncount=1' ); ?> It works fine, with number of posts per author and author page link https://images2.imgbox....
arteaster's user avatar
0 votes
1 answer
73 views

How do I add nopin="nopin" to the default avatar?

I noticed that if someone clicks on my Pinterest share button on a blog post, several unrelated images show up. I was able to use nopin="nopin" per Pinterest's documentation on most of these ...
Jim's user avatar
  • 7
0 votes
1 answer
274 views

Avatar picture is broken

I've loaded and reloaded my picture into Gravatar, but it still displays as broken in my admin panel. Also, the email address for my Gravatar account is the same as the email address in my admin ...
Julie P. Tuggle's user avatar
3 votes
2 answers
1k views

Listing all users by their avatars in wordpress

I want to list pictures of all avatars how do I do this
Mehmet Cemil's user avatar
1 vote
1 answer
679 views

How to change avatar of the comment author using comment ID?

One visitor commented on one of my post as a guest. Now, i want to change avatar of this comment using comment ID. Comment ID of the comment is 1092. How can i change avatar of the comment using ...
Divyang's user avatar
  • 13
0 votes
1 answer
364 views

Convert User's Avatar/Gravatar to a jpg or png on the Fly

Is there a way to convert a user's gravatar/avatar to jpg on the fly? I have the following in my function: get_avatar( $uid, 180 ); which returns the user's avatar image if I call it with straight ...
Daniel Florian's user avatar
0 votes
1 answer
479 views

Gender based user avatar

I'm creating a matrimonial website. I want to set the user avatar based on the gender(I have a custom_user_meta for the user's gender) But I don't understand how to get the "user id" in order to use ...
shimii's user avatar
  • 15
0 votes
1 answer
42 views

How to prevent a specific users's profile photo (gravatar) from showing on the frontend to other users?

Yes, I need a code to do that. Plugin is not an option, I need to use theme's functions.php file. Maybe this filter would help: apply_filters( 'get_avatar', string $avatar, mixed $id_or_email, int $...
Luis Rock's user avatar
  • 139
0 votes
1 answer
416 views

get_avatar filter is not working as per requirement

I have an author loop with a profile picture that saves into ACF custom fields and I want to use it as get_avatar but it returns blank. Here is a snippet: $get_avatar = get_user_meta($user->ID, "...
Shadow's user avatar
  • 68
4 votes
1 answer
2k views

How to check if gravatar of user is the default's one?

I am looking for a way to check if the user has the default gravatar. It doesn't work if I use a simple get_avatar( current_user_id() ) === false as the default gravatar is still an avatar so it ...
Pipo's user avatar
  • 609
0 votes
1 answer
70 views

Custom Field Repeating When Using foreach

I'm trying to display user avatars by login user name using custom fields like this - And here's the code - function user_avatar() { $name = get_post_meta( get_the_ID(), 'user_name', true )...
Brad Dalton's user avatar
  • 6,967
2 votes
2 answers
1k views

How to replace any occurence of Gravatars with a local placeholder image?

Users can upload an avatar as a local image file on my website. If they didn't do so, it will fall back to the WordPress default (Gravatar). But I want any occurrence of Gravatar to be replaced with a ...
Florian Walther's user avatar
0 votes
1 answer
2k views

i1.wp.com url problem (Jetpack not installed)

I added the following code to the functions.php file add_filter( 'avatar_defaults', 'new_gravatar' ); function new_gravatar ($avatar_defaults) { $myavatar = 'link'; $avatar_defaults[$...
A. Muller's user avatar
1 vote
0 answers
36 views

WordPress Gravatar filter is removing my custom attributes

I am trying to add a style attribute on all the custom gravatar images. However, it is removing the style attribute before final output. Here is the code I am using: $background = ''; $args = [$...
iKnowNothing's user avatar
0 votes
1 answer
3k views

How to get User Avatar Image with link to Author and User name in Html Title tag?

I'm wondering how could I achieve this result mixing the avatar image with href to author page and also when the mouse is over the image, show in "html title tag" the name of the user? I know I can ...
Diego's user avatar
  • 1
2 votes
0 answers
939 views

Assign a random avatar to every user?

I have 10k users on my site and only around 1k of them are using custom avatars (through a shortcode avatar upload I have). The rest are using a default (and custom) singular gravatar image. I want ...
GenesisBits's user avatar
2 votes
1 answer
850 views

Changing default Buddypress avatar affects all site avatars (because gravatar)

I've been looking for a way to change the default Buddypress avatar for members, and have managed it, partially just using the simple Buddypress codex info here. BUT The codex info doesn't quite do ...
Haazna's user avatar
  • 33
0 votes
2 answers
341 views

Gravatar image url is wrong?

I have this code that pulls a user's gravatar: if( $current_user->ID == 0 ) { // Not logged in. echo '<p><img src="'.get_stylesheet_directory_uri().'/img/wpb-default-gravatar.png" ...
odedta's user avatar
  • 96
1 vote
0 answers
30 views

In this snippet how do I force the function to use gravatar rated G and fill in the alt for get_avatar()?

$title = sprintf( '%1$s<span class="vcard">%2$s</span>', get_avatar( get_the_author_meta( 'ID' ), 75, set_url_scheme( 'https'), '', '' ),//TODO Full avatar via gravatar ...
Denver Prophit Jr.'s user avatar
2 votes
5 answers
1k views

How to output nothing instead of default avatar?

I am looking for a solution to output nothing instead the default avatar when a user does not have any avatar. I am currently using this line. I looked at the function and the only thing I got so far ...
NextGenThemes's user avatar
1 vote
1 answer
1k views

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 : [email protected] ...
Sid's user avatar
  • 129
0 votes
1 answer
3k views

How to add custom class to get_avatar()

I am using a custom walker class to customize my comments section. It uses the following code to get the comment author image from gravatar <?php if ( 0 != $args['avatar_size'] ) echo get_avatar( $...
user avatar
2 votes
1 answer
88 views

Replace comment avatars and links at the same time

I am trying to replace Wordpress comment author data: 1) Avatar (uploaded image instead of Gravatar) 2) Author link (link to author page as only members can comment) I have found a great solution ...
fjanecic's user avatar
1 vote
0 answers
20 views

Gravatar not showing when calling users details

I am pulling out users details from a custom role I have created which works great apart from the avatar. It did flash up and then refreshed disappeared again which is odd in itself... I can see the ...
Dan's user avatar
  • 11
1 vote
0 answers
120 views

Custom avatar image link added to the profile page

I'm trying to create a custom author field, the user will past his profile image url. and replace his avatar which displayed in comments. the field : function custom_avatar_img($profile_fields) { $...
hazemhazem's user avatar
0 votes
1 answer
1k views

Avatar picture does not display when using get_avatar

I'm using WordPress with bbPress and Gravatar for user avatars. I want to display the user's avatar next to their topic. I'm using: echo get_avatar( get_the_author_meta( 'ID' ), 32 ); Which get's ...
ouqas mohamed's user avatar
0 votes
1 answer
886 views

Working with Gravatars within a localhost development area

Is is possible to add an author photo (gravatar), while developing our WordPress site offline in a /localhost environment? I see that the gravator process is requesting for an online site to be ...
klewis's user avatar
  • 899
0 votes
3 answers
2k views

Wordpress User Gravatar images not displaying. Loading default instead

I'm trying to display user gravatars on this page http://gepc.themelot.com/survey-comparison/433747624/293281083/ but the page keeps showing the default 'mystery man' avatar. I inspected the page ...
Sosthenes Kwame Boame's user avatar
3 votes
3 answers
3k views

Custom user avatar in the Wordpress users listing

By default, Wordpress uses Gravatar for user avatars. I've created a custom field for avatar uploads, and I'm using this as users' avatars on various pages in the theme. In the admin - on the all ...
Koleon's user avatar
  • 41
1 vote
0 answers
795 views

Customize Avatar using user meta

I have a customer where all the users are synchronized through an API every night. This API gives me the profile picture for each user and it is stored as a user meta with meta_key = 'image'. Is ...
Jorgen's user avatar
  • 141
2 votes
1 answer
2k views

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 ...
Robert Andrews's user avatar
2 votes
1 answer
880 views

How to Add a Random Custom Gravatar in the WordPress Comments?

I have a client that has 5 different gravatar images, and would like them to be randomly used as the thumbnail for people's comments that have no Gravatar. I know how to change the Gravatar to a ...
Michael Musgrove's user avatar
5 votes
4 answers
22k views

Replace Gravatar with uploaded images?

I've added functionality to upload profile picture by following THIS guide. I can't find an online guide or any documentation about WP hooks.. How to replace Gravatar profile pictures (in comment ...
N00b's user avatar
  • 2,179
-1 votes
1 answer
1k views

How can I changing or replace user's avatar without plugins?

I want to change Gravatar from my website. But I don't know how to change it? Please some one help me. I do not want to use plugins. I need step by step instructions because I'm not expert.
Mohi Uddin's user avatar
2 votes
1 answer
51 views

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 ...
Cédric Charles's user avatar
1 vote
2 answers
1k views

How to change Gravatar size when using comments_template

I am trying to change default Gravatar size. Since I am using WP-generated comments template (using comments_template() function), I turned to filters and this is my custom code: function ...
Bruno Kos's user avatar
  • 278
0 votes
2 answers
185 views

Adding avatars/gravatar to a Wordpress blog

I am trying to add avatars to my wordpress web site and I activated them through the settings - discussion as you would normally do. But because I have a very customised theme, I guess, it is not ...
vega's user avatar
  • 65
0 votes
2 answers
2k views

How do I get a post author's image/avatar via RSS from another blog?

I have 2 websites: one is a company website, the other is a blog for the company - these sites are on separate domains. On the homepage of the company website, there's a square tile featuring the ...
andrw22's user avatar
  • 61
0 votes
0 answers
152 views

GravatarLocalCache Plugin Broken in WordPress 4.2

Trying to fix a plugin (https://wordpress.org/plugins/gravatarlocalcache/ not mine) which broke on the 4.2 update. The plugin makes a locally cached version of Gravatar.com avatars. Plugin hasn't ...
David Law's user avatar
  • 143
0 votes
2 answers
169 views

Wordpress shows admin's avatar after editing a comment

Recently I updated my wordpress to 4.2.1 and now I have a problem with editing people's comments. After editing them, the avatar picture of who edited the comment is shown instead of the avatar of the ...
Amirreza Nasiri's user avatar
3 votes
2 answers
536 views

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'] = __( '...
henrywright's user avatar
  • 3,107
3 votes
2 answers
1k views

Wrong gravatar showing up?

I've got an install that's loading the wrong gravatar and I can't figure out why. Most confusing is that it's doing it in the front-end templates AND in the admin. Here's a screen cap: The user and ...
clark's user avatar
  • 591
0 votes
2 answers
901 views

How to get all users that uploaded avatars or have gravatars? [closed]

Is there a way to get all users that: 1) uploaded an avatar or 2) have a Gravatar? I want to filter users that doesn't meet one of these conditions. UPDATE I forget to mention that this is for ...
Yuri's user avatar
  • 1,131
0 votes
3 answers
3k views

Show custom default avatar instead of gravatar

I'm using this custom function to get the default avatar from my server instead of gravatar: if(!function_exists('custom_avatar')){ function custom_avatar($avatar_defaults){ $...
user3705773's user avatar
0 votes
1 answer
176 views

Increase Comment Author Gravatar Size On WordPress Default Comment Function

I am new to WordPress theme development. I am designing a new theme and using less codes and file as I am starting from basic. I am adding comments and comment form in my single.php using <?php ...
Muhammad Hassan's user avatar
4 votes
2 answers
4k views

Custom Gravatar not working

I'm trying to upload a custom Gravatar to Wordpress, however something is breaking the image link and I'm not sure how to fix it. add_filter( 'avatar_defaults', 'new_default_avatar' ); function ...
Anindya Basu's user avatar
3 votes
3 answers
5k views

How do I add a custom HTML attribute to get_avatar?

I'm trying to add Pinterest's nopin="nopin" HTML attribute to the comment avatar image tags on my blog. Here's the function I'm using to call the avatar on each comment: get_avatar($comment, 50, ...
Thomas Frank's user avatar
0 votes
1 answer
164 views

Adding custom avatar field to comments

I want to store a users Twitter Profile Image when I found out that they've tweeted the link of a post (by using the Twitter API), but I'm stuck with the following issue: How do I store the Profile ...
Andre's user avatar
  • 101
1 vote
2 answers
2k views

custom default avatar showing broken link

I am using the follow function to create a custom default avatar for users who comment and do not have a gravatar setup. if(!function_exists('custom_avatar')){ function custom_avatar($...
tech's user avatar
  • 35