由于评论头像的有和无,致使我们的界面看起来杂乱无章,这里我们说下剔除无头像评论:
首先(在functions.php里加入如下代码:)

  

然后在你调用评论排行的地方找到你的hook,类似foreach ($comments as $comment)
在后面加上

  

例子(如下代码红色部分)

$i =1;  
comment_author_email)) {  
{ $width = round(40 / ($maxNum / $comment->cnt),2); if( $comment->comment_author_url ) $url = $comment->comment_author_url; else $url=”#”; $avatar = get_avatar( $comment->comment_author_email, $size = ’36’); $result = ‘
  • 《a rel=”nofollow” target=_blank class=”no-ce” href=”‘.$comment->comment_author_url.'” title=”‘.$comment->comment_author.’:’.$comment->cnt.’条评论”>’.$avatar.'
  • ’; $output .= $result; $i++; if($i>10)//10改成你想要的数字 break; } } ?>

    最后检查你的foreach前面的代码是否有 LIMIT 18,将数字改大一点,多调试,尽量够在显示的比如30条内足够筛选出数量来显示你的排行头像。

    正文到此结束