adrianhanft
Forum Replies Created
-
Forum: Plugins
In reply to: Gravatar is “Posts” ?I am trying to get an author’s gravatar to show up on an author’s profile page. None of the comments here worked for me, so I thought I would show you the code that worked for me in case anyone else runs into this problem. This is the code I put in my auther template:
<?php echo "<img src='";
echo gravatar($curauth->user_email);
echo "' alt='' class='gravatar' width='80' height='80' HSPACE=10 ALIGN=RIGHT />"; ?>
Forum: Fixing WordPress
In reply to: Gravatar for Current User in Sidebarcarnold,
I am probably the last person that should be giving advice about php and wordpress, but here is the code I used on my sidebar. It gives the user info (and gravatar) for the user who is signed in. On my site you have to sign in before you can see anything on the blog, so this works as a “my profile” type of feature. I hope it helps. Please somebody with more experience chime in because I can’t elaborate on this at all. Sorry!
<h2><?php global $userdata; get_currentuserinfo();
echo($userdata->first_name);
echo " ";
echo($userdata->last_name); ?></h2><?php global $user_email;
get_currentuserinfo();
echo "<img src='";
echo gravatar($user_email);
echo "' alt='' class='gravatar' width='80' height='80' ALIGN=RIGHT />";
?>- Nickname:
<?php global $userdata; get_currentuserinfo(); echo($userdata->user_login); ?> - user_url; ?>"><?php echo $userdata->user_url; ?>
- Edit My Profile
Forum: Fixing WordPress
In reply to: Gravatar for Current User in SidebarActually the code above wasn’t quite right. Try this:
<?php global $user_email;
get_currentuserinfo();gravatar_image($user_email);
?>
Forum: Fixing WordPress
In reply to: Gravatar for Current User in SidebarI eventually got this to work. If anyone has a similar problem I recommend you upgrade to Gravatar2 and then use this code:
<?php if (function_exists('gravatar')) { gravatar_image($userdata->user_email); } ?>
- Nickname: