Gravatar for Current User in Sidebar
-
Can someone help me with something I am trying to do on my blog? When an author is logged in, I would like to show his/her gravatar in the sidebar along with some of their profile information. I am new to WordPress (from Movable Type) and don’t have a good grasp on the php of WordPress yet. Here is the code that I have tried without success:
My Gravatar: <?php if (function_exists('gravatar')) {
echo "<img src='";
echo gravatar($curauth->user-email);
echo "' alt='' class='gravatar' />";}
?>
and
My Gravatar: <?php if (function_exists('gravatar')) {
$user_gravatar = wp_gravatar($curauth->user-email);echo "<img src='$user_gravatar' />";}
?>It seems like it should work, but then again I don’t know what I am doing. Thanks for your help in advance!
- The topic ‘Gravatar for Current User in Sidebar’ is closed to new replies.