Support » Plugins » Gravatar as poster

  • Resolved icco

    (@icco)


    I recently started using gravatar, and im wondering if anyone knows a way to make it so you can have an icon next to the post to show who posted it.

Viewing 15 replies - 1 through 15 (of 35 total)
  • The Gravatar site has instructions for doing this.

    really? would you mind pointing it out i cant seem to find it.

    ya but how do i apply this to the poster of the article not the comment.

    bump, is this possible?

    The logical place to put it would be in the index.php before or after
    <?php the_author() ?> but I just tried and it didn’t show up.

    hmm ok thanks for trying.

    Insert the following (within the loop, of course)
    $grav_email=$authordata->user_email;
    $grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5($grav_email)."&amp;default=".urlencode($default)."&amp;size=".$size;
    echo "<img src=\"$grav_url\" alt=\"gravatar\"/>" ;

    umm im not exactly sure what the loop is. thanks for the answer though.

    OK i think that that response i made is a litttle to general. Im wondering now if i put that in the index page or the plugin page, and where on those pages i should put it.

    You can do this without using gravatar if you want. I was able to figure it out for my site without gravatar.

    well i could put an image next to my name, but i would like it to be the same as the image from gravatar

    okay, enclose that little bit in <?php and ?> and place it in the code of your index page wherever you want the image to be display. if you are using 1.5, add it to the index of your theme and into whatever other templates you want with the image.

    so this is what i have right now, but nothing is showing up…

    <div class=”post”>
    <h3 class=”storytitle” id=”post-<?php the_ID(); ?>”>” rel=”bookmark” title=”Permanent Link: <?php the_title(); ?>”><?php the_title(); ?></h3>
    <div class=”meta”><?php _e(“Filed under:”); ?> <?php the_category() ?> — <?php $grav_email=$authordata->user_email;
    $grav_url = “http://www.gravatar.com/avatar.php?gravatar_id=”.md5($grav_email).”&default=”.urlencode($default).”&size=”.$size;
    echo “<img src=\”$grav_url\” alt=\”gravatar\”/>” ; the_author() ?> @ <?php the_time() ?> <?php edit_post_link(); ?></div>

    o ya im using wp 1.2.2

    a gravatar is there but its not choosing the right one. that php code supplied is wrong cuz while it does call the correct image when i try to load it in a new window it somehow doesn’t show up right on your site. add #content div.post div.meta img { height: 80px;} to your css to see the “blank gravatar” being called.

Viewing 15 replies - 1 through 15 (of 35 total)
  • The topic ‘Gravatar as poster’ is closed to new replies.