Support » Fixing WordPress » Link Avatar Image in Comments
6 years, 2 months ago
Hello everyone! 🙂
I’m trying to make gravatars link to the commentor’s website.
I tried to wrap a link around <?php echo get_avatar($comment,$size=’64’); ?> but nothing is happening. Can you put a php echo inside a link? my understanding is that the output is an img?
here’s my code at the moment, everything is displaying fine but not linking to the comment author’s site.
<a href="www.google.com" target="_blank" rel="nofollow"><?php echo get_avatar($comment,$size='64'); ?></a>
Also, as an aside, i’d also like to include an if statement to check if the commentor entered a website and only link if they did. i’m new to php etc but know java pretty well.
really really appreciate the help! 🙂