Hot answers tagged

3

As an alternative to my other answer, you can also use the get_avatar filter. Props to Sumit to alerting me to this one. The benefit of using the get_avatar filter is your custom avatar should be applied anywhere Wordpress uses it, rather than just in this users list like my other answer deals with. If you use plugins that display user avatars, this ...


2

We could also use one of the following filters, available since WordPress 4.2: pre_get_avatar_data get_avatar_url get_avatar_data Regarding how to get the user ID from the $id_or_email we can see how it's done in the core: $email_hash = ''; $user = $email = false; if ( is_object( $id_or_email ) && isset( $id_or_email->comment_ID ) ) { $...


1

EDIT: My original solution is below, but Sumit alerted me in the comments to the existence of the get_avatar filter. I've posted an additional answer that shows how to implement that option as well. Yes, you can do this. The columns displayed in any of these 'list tables' in Wordpress admin are filterable - so using a custom function in your theme's ...


1

Unless I have misunderstood your question to accomplish a custom gravatar to use in your theme add the code below to your functions.php or into a custom plugin. From there customize the title and the image you want to use. See screenshot below for the finished outcome. add_filter( 'avatar_defaults', 'dev_designs_gravatar' ); /** * Display a custom ...


1

Have a look at the Codex about "Using Gravatars". There you´ll find a part about "Checking for the Existence of a Gravatar" which works like this: The trick to do this is to specify "404" as the default. In this case, the gravatar service will return a 404 error if no gravatar exists, instead of returning some default image. A real image will get a 200 ...


1

1 Visit Gravatar website 2 Sign in to Gravatar with your WordPress.com account. If you don’t have a WordPress.com account then you need to create one. 3 Upload your avatar ( profile picture ). and you are done with it.


1

Gravatar by design doesn't require the downstream system to be aware if there is a match. The image (if any) is determined and served on request, only hash needs to be provided. It's impossible to "guess" from email or its hash if it has an avatar. That can only be resolved by request to the Gravatar. Basically to achieve this you will need to: query ...


1

You're looking for the get_avatar function, documented here get_avatar( $id_or_email, $size, $default, $alt ) You'll need either a user ID, or an email to use it, something like this should do the trick: echo get_avatar( get_comment_author_email(), 'thumbnail' ); If avatars are turned off in settings, this function will not return anything


1

Answer get_avatar($comment, 50, vol_random_image(), '', array('extra_attr' => 'nopin="nopin"')); Explanation Take a look at the get_avatar function: echo get_avatar( $id_or_email, $size, $default, $alt, $args ); Looking at this function, you'll notice the last parameter allowed is $args, which essentially lets you alter all values aside from $...



Only top voted, non community-wiki answers of a minimum length are eligible