WordPress.org

Ready to get started?Download WordPress

Forums

Can't replace default Gravatar (3 posts)

  1. chestmclargehuge
    Member
    Posted 6 years ago #

    I'm trying to replace the default gravatar from the Gravatar plug-in v1.1 From what I'm reading the code is in the comments.php file. The only code I can find is below. I'm assuming I'd put a url after ...40"? I tried that but didn't work. Any help would be great.

    <div class="gravatar"> </div>
    <?php
    } else {
    ?>
    <div class="gravatar"><img src="http://www.gravatar.com/avatar.php?gravatar_id=<?php echo md5($comment->comment_author_email); ?>&rating=PG&size=40" /></div>
    <?
    }
    ?>

  2. Jason Keath
    Member
    Posted 5 years ago #

    It has been a while, but figured I would post an answer seeing as others may have the same issue.

    You are correct, the URL for your devault gravatar goes after the 40

    Example before and after:

    Before
    <?php echo get_avatar( $comment, $size='60' ); ?>

    After
    <?php echo get_avatar( $comment, $size='60', 'http://insert-your.default-gravatar.replacement-image-url/here.png' ); ?>

  3. Jason Keath
    Member
    Posted 5 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic