Search code examples
phpwordpresscomments

Browser display problems for Wordpress comments, Twenty-Eleven theme


My wordpress site uses a child theme for the twenty-eleven theme. The problem I'm having is that next to each comment, a broken image link appears. But this only happens in Chrome, Safari, and Opera. In Firefox and IE it isn't there.

The weird thing is, when I right-click on the broken-image link to try to inspect it in the source code, there's nothing there. It's no where in the DOM!!!

I've tried going into Wordpress' Discussion settings and changing Avatar Display to Don't Show, and Default Avatar to blank. I have removed all the code to display avatars from twenty-eleven's functions.php (in the function twentyeleven-comment). I have tried every possible CSS solution I could think of, and I can't get them to go away.

You can see what I'm talking about here: http://www.andersonandsonsfh.com/2011/07/gordon-severson/

I don't really know what code to include, so here is my code for twentyeleven_comment

if ( ! function_exists( 'twentyeleven_comment' ) ) :
function twentyeleven_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
    case 'pingback' :
    case 'trackback' :
?>
<li class="post pingback">
    <p><?php _e( 'Pingback:', 'twentyeleven' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?></p>
<?php
        break;
    default :
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
    <article id="comment-<?php comment_ID(); ?>" class="comment">
        <footer class="comment-meta">
            <div class="comment-author vcard">
                <?php

                    /* translators: 1: comment author, 2: date and time */
                    printf( __( '%1$s on %2$s <span class="says">said:</span>', 'twentyeleven' ),
                        sprintf( '<span class="fn">%s</span>', get_comment_author_link() ),
                        sprintf( '<a href="%1$s"><time pubdate datetime="%2$s">%3$s</time></a>',
                            esc_url( get_comment_link( $comment->comment_ID ) ),
                            get_comment_time( 'c' ),
                            /* translators: 1: date, 2: time */
                            sprintf( __( '%1$s at %2$s', 'twentyeleven' ), get_comment_date(), get_comment_time() )
                        )
                    );
                ?>

                <?php edit_comment_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
            </div><!-- .comment-author .vcard -->

            <?php if ( $comment->comment_approved == '0' ) : ?>
                <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentyeleven' ); ?></em>
                <br />
            <?php endif; ?>

        </footer>

        <div class="comment-content"><?php comment_text(); ?></div>

        <div class="reply">
            <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply <span>&darr;</span>', 'twentyeleven' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
        </div><!-- .reply -->
    </article><!-- #comment-## -->

<?php
        break;
endswitch;
}
endif; // ends check for twentyeleven_comment()

Please help! This is driving me crazy!


Solution

  • Use Firebug with Firefox, or in Chrome or Safari or IE8, use the developer tools to see what's loading on your site. You'll see a 404 for the image comment-arrow.png, and that's called in style.css and should be in /images/. Remove the call in style.css to get rid of the image, or be sure the image is in the folder so it displays.