Not all your images on that page have issues. For example: http://gravatar.com/avatar/619d8e38359241a952a1f9b67f1f36cd?s=60&d=mm
The rest of the images aren’t displaying because the emails you’ve encoded are not recognized with gravatar. The default image shows because you are specifying to use mm
when the image can’t be found for your hash. They have several tips for normalizing the email like trim
and strtolower
to get a better hash hit.
Creating a hash:
- Trim leading and trailing whitespace from an email address
- Force all characters to lower-case
- md5 hash the final string
echo md5( strtolower( trim( “[email protected] ” ) ) );
$user = get_user_by( 'user_login', $value['user'] );
$user_email = $user->user_email;
$url="http://gravatar.com/avatar/" . md5(strtolower(trim($user_email)));
$url = add_query_arg( array(
's' => 80,
'd' => 'mm',
), $url );
$gravatar_url = esc_url_raw( $url );
Gravatar API – Default Image
Change the default image from mm
to https%3A%2F%2Fplacekitten.com%2F256%2F256
by specifying the d
parameter.
404: do not load any image if none is associated with the email hash, instead return an HTTP 404 (File Not Found) response
- mm: (mystery-man) a simple, cartoon-style silhouetted outline of a person (does not vary by email hash)
- identicon: a geometric pattern based on an email hash
- monsterid: a generated ‘monster’ with different colors, faces, etc
- wavatar: generated faces with differing features and backgrounds
- retro: awesome generated, 8-bit arcade-style pixelated faces
- blank: a transparent PNG image (border added to HTML below for demonstration purposes)
Just remember, not every email has a gravatar which is why the default image exists.