How to make your website support Gravatar

Source: Internet
Author: User
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

  1. Download Plugin: http://site.gravatar.com/plugins/wp_gravatar.zip
  2. Activate plug-ins
  3. 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 }?>

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.