The Gravatar site has instructions for doing this.
Thread Starter
icco
(@icco)
really? would you mind pointing it out i cant seem to find it.
Thread Starter
icco
(@icco)
ya but how do i apply this to the poster of the article not the comment.
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.
Thread Starter
icco
(@icco)
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)."&default=".urlencode($default)."&size=".$size;
echo "<img src=\"$grav_url\" alt=\"gravatar\"/>" ;
Thread Starter
icco
(@icco)
umm im not exactly sure what the loop is. thanks for the answer though.
Thread Starter
icco
(@icco)
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.
Thread Starter
icco
(@icco)
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.
Thread Starter
icco
(@icco)
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.