Showing Commenter Avatars (1 post)

  1. swami12
    Posted 3 years ago #

    My blog is not showing avatars of commenters. I think something has changed that necessitates a change to my theme's comments.php file.

    It has :

    <div class="comments">
        <h3><?php comments_number('No Responses', 'One Response', '% Responses' );?> to “<?php the_title(); ?>”</h3>
        <ol class="commentlist">
        <?php foreach ($comments as $comment) : ?>
            <li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">
                <?php comment_text() ?>
                <p class="commentmetadata">
                    <?php echo get_avatar( $id_or_email, $size = '32'); ?>
                    <cite><?php comment_author_link() ?></cite> said this on
                    <?php if ($comment->comment_approved == '0') : ?>
                    <em>Your comment is awaiting moderation.</em>
                    <?php endif; ?>
                    <a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a> <?php edit_comment_link('edit','(',')'); ?>
        <?php /* Changes every other comment to a different class */
            if ('alt' == $oddcomment) $oddcomment = '';
            else $oddcomment = 'alt';
        <?php endforeach; /* end for each comment */ ?>

    I tried replacing:
    <?php echo get_avatar( $id_or_email, $size = '32'); ?>
    <?php wp_list_comments( array( 'avatar_size' => '50' ) ); ?>

    Gravatars appeared, but I do not know how to integrate this into the original structure .... I can't just replace that one line (comments repeated ad infinitum).

    Any help in fixing up this PHP would be appreciated!


Topic Closed

This topic has been closed to new replies.

About this Topic