I have implemented gravatar for a portal I am building and wanted to know if there is a default image URL for gravatar? Not all people who visit the site are logged in or have email addresses, in such a case, is there a default image that can be shown (accessible via gravatar url)
If you wish to change the default avatar, in the WordPress admin dashboard, head to Settings > Discussion. Scroll down to the Default Avatar section and you'll see a few additional options are provided for selection.
A Gravatar is a Globally Recognized Avatar. You upload an image and create your public profile just once, and then when you participate in any Gravatar-enabled site, your Gravatar image and public profile will automatically follow you there. Gravatar is a free service for site owners, developers, and users.
Yes, Gravatar is just another term for/type of avatar. It's just your user image, and yes, on other blogs/sites that support Gravatar, your image will come with you.
To select a default image, you can use the d
parameter:
http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802?d=identicon
Or without a hash:
http://www.gravatar.com/avatar/?d=identicon
Or without the d
parameter:
http://www.gravatar.com/avatar
Source: gravatar.com.
Gravatar describe the options for default images here: http://en.gravatar.com/site/implement/images/
You can select which option you want by adding the appropriate name/value pair to your url. For example, you could use "mystery person" (d=mp) which looks like this:
The above image was created with the url http://www.gravatar.com/avatar/?d=mp
. Note that the email hash string has been omitted but normally you would include it as part of the request.
Options listed at the above link:
- 404: do not load any image if none is associated with the email hash, instead return an HTTP 404 (File Not Found) response
- mp: (mystery-person) 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
- robohash: a generated robot with different colors, faces, etc
- blank: a transparent PNG image (border added to HTML below for demonstration purposes)
As you would hope, using the size option s=<pixels>
also changes the size of the default image.
The above image was created with http://www.gravatar.com/avatar/?d=retro&s=32
Thanks to @Alireza Rezaee for the updated image types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With