Results 1 to 4 of 4

Thread: Inseart Gravatar to WordPress themes

  1. #1
    Join Date
    May 2009

    Inseart Gravatar to WordPress themes

    As a blog owner i would like to make my blog much attractive. For doing so i got an idea of Gravatars so that i can add personal touch to my blog comments by displaying the avatar of the commenter alongside their comment. But i am not aware of how to do it ? Hope you all guys can help me out here. Please make me know how can i add Gravatars to my WordPress theme ? Help appreciated.

  2. #2
    Join Date
    May 2009

    Re: Inseart Gravatar to WordPress themes

    A gravatar, or globally recognized avatar, is quite simply an image that follows you from site to site appearing beside your name when you do things. Avatars help identify your posts on blogs and web forums. The function to add Gravatars to your theme is called: get_avatar.

    First you need to enable your wordpress theme to display avatars. Afer logging into Wordpress admin, go to Settings > Discussion and for the Avatars.

    The function returns a complete image HTML tag of the Avatar.

    The function is called as follows:
    echo get_avatar( $id_or_email, $size = '96', $default = '<path_to_url>' );
    Once you enable the to display avatars, set the php code in your comments.php in the appropriate area where you want the avatars to appear. The PHP code will be like this:
    <?php if(function_exists('get_avatar')) { echo get_avatar($comment, '40'); } ?>
    The default output is when using the above function is listed below. Various classes are applied to img element to help you with element styling:

    <img alt='' src='http://gravatarurl_or_default'
    class='avatar avatar-$size' height='$size' width='$size' />
    If the gravatar reverts to the default image due to a lack of an e-mail address (i.e. a pingback or trackback), whether you have specified a default or not, the img element will also be given a CSS class of avatar-default.

  3. #3
    Join Date
    Apr 2008

    Re: Inseart Gravatar to WordPress themes

    Setting up gravatars on your site is easy, you don't even need an account! Plugins are available for leading blog software and content management systems, and our tutorials will have you running gravatars in no time. To request a gravatar from our servers, you simply add an image to your users activity with an "src" attribute that points to our gravatar image generator and includes an MD5 hash of the user's email address. Since all gravatars are rated with an MPAA style rating, you can restrict your site to show only gravatars whose content you are comfortable with.

  4. #4
    Join Date
    May 2008

    Re: Inseart Gravatar to WordPress themes

    A Gravatar is a dynamic image resource that is requested from a server. The request URL is presented here, broken into its segments. The URL always begins with:
    A mandatory parameter named gravatar_id follows this. Its value is the hexadecimal MD5 hash of the requested users' email address with all whitespace trimmed. The value is case insensitive.

    The parameters are:

    • id_or_email (required): Author’s User ID (an integer or string), an E-mail Address (a string) or the comment object from the comment loop. Note: with most comment templates you can use $comment here, in order to display the gravatar of the commenter. In other templates, you can use get_the_author_id() here.
    • size (optional): Avatar display size (max is 512).
    • default (optional): Absolute location of the default avatar to use

Similar Threads

  1. How to Convert PSD To Wordpress Themes
    By Pabloa in forum Technology & Internet
    Replies: 5
    Last Post: 13-04-2010, 07:40 PM
  2. New wordpress themes 2010
    By Techno01 in forum Technology & Internet
    Replies: 3
    Last Post: 02-02-2010, 05:53 PM
  3. Is any free themes for wordpress
    By Steyn in forum Technology & Internet
    Replies: 4
    Last Post: 29-01-2010, 04:43 AM
  4. Editing Wordpress Themes with help of Dreamweaver
    By KAMAL60 in forum Software Development
    Replies: 3
    Last Post: 07-11-2009, 08:03 PM
  5. what is wordpress? How to install Newer versions of wordpress.
    By Gill_christ in forum Technology & Internet
    Replies: 3
    Last Post: 21-05-2009, 02:40 PM

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Page generated in 1,721,643,331.56667 seconds with 17 queries