WordPress.org

Ready to get started?Download WordPress

Forums

Link Avatar Image in Comments (1 post)

  1. unleashreality
    Member
    Posted 3 years 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.

    <div class="avatar">
    <a href="www.google.com" target="_blank" rel="nofollow"><?php echo get_avatar($comment,$size='64'); ?></a>
    </div>

    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! :)
    alex

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 3 years ago by unleashreality
  • This topic is not resolved
  • WordPress version: 3.0.1