【问题标题】:Browser display problems for Wordpress comments, Twenty-Eleven themeWordpress 评论的浏览器显示问题,二十一主题
【发布时间】:2012-02-14 11:57:32
【问题描述】:

我的 wordpress 网站使用子主题作为 21 主题。我遇到的问题是,在每条评论旁边,都会出现一个损坏的图像链接。但这只发生在 Chrome、Safari 和 Opera 中。在 Firefox 和 IE 中不存在。

奇怪的是,当我右键单击损坏的图像链接以尝试在源代码中检查它时,那里什么都没有。它不在 DOM 中!!!

我尝试进入 Wordpress 的讨论设置并将头像显示更改为不显示,并将默认头像更改为空白。我已经从 211 的 functions.php 中删除了所有显示头像的代码(在函数 211-comment 中)。我已经尝试了我能想到的所有可能的 CSS 解决方案,但我无法让它们消失。

你可以在这里看到我在说什么:http://www.andersonandsonsfh.com/2011/07/gordon-severson/

我真的不知道要包含什么代码,所以这是我的 211_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()

请帮忙!这快把我逼疯了!

【问题讨论】:

    标签: wordpress comments


    【解决方案1】:

    在 Firefox、Chrome、Safari 或 IE8 中使用 Firebug,使用开发人员工具查看您网站上正在加载的内容。您将看到图像 comment-arrow.png 的 404,它在 style.css 中调用,应该在 /images/ 中。删除 style.css 中的调用以摆脱图像,或确保图像在文件夹中以便显示。

    【讨论】:

      猜你喜欢
      • 2012-09-06
      • 2014-03-07
      • 2015-05-26
      • 2013-06-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-16
      相关资源
      最近更新 更多