What is Gravatar? Click here to know |
Non-WordPress website
Code<? PHP
If (! Empty ($ email variable) {$ MD5 = MD5 ($ email variable); $ default = urlencode ('default image address ');
Echo " ";
}
?> |
|
Use built-in templates for WordPress 2.7
WordPress 2.7 custom template
Insert Code where appropriate If (function_exists ('get _ avatar ')){ // If avatar is supported, add the avatar code here. } Else { // If not, other content is displayed here } Function get_avatar ($ id_or_email, $ size = '64', $ default = '')
- $ Id_or_email user ID (an integer or string) or an email address
- $ Size Avatar size
- $ Default avatar is set by entering the URL of an avatar Image
|
Less than WordPress 2.7
- Download Plugin: http://site.gravatar.com/plugins/wp_gravatar.zip
- Activate plug-ins
- Insert code in a proper place. For example, I used it as an example. This is probably the case.
Code <? Php // Gravatar (grading code, size, default image) if (function_exists ("gravatar") {?> "Alt =" Gravatar "class =" gravatar "width =" 32 "height =" 32 "/> <? Php }?>
|