删除侧边栏的“言论排行榜”版块
如果您发现本文排版有问题,可以先点击下面的链接切换至老版进行查看!!!
删除侧边栏的“言论排行榜”版块
<h3>本月言论榜</h3>
<ul>
<?php
$counts = $wpdb->get_results("SELECT COUNT(comment_author) AS cnt, comment_author, comment_author_url, comment_author_email FROM (SELECT * FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->posts.ID=$wpdb->comments.comment_post_ID) WHERE comment_date > date_sub( NOW(), INTERVAL 1 MONTH ) AND user_id='0' AND comment_author != '' AND post_password='' AND comment_approved='1' AND comment_type='') AS tempcmt GROUP BY comment_author ORDER BY cnt DESC LIMIT 18");
foreach ($counts as $count) {
$a = get_bloginfo('wpurl') . '/wp-content/avatar/' . md5(strtolower($count->comment_author_email)) . '.jpg';
$d = get_bloginfo('wpurl'). '/wp-content/avatar/default.jpg';
$c_url = $count->comment_author_url;
if ($c_url == '') $c_url = 'https://www.daozhao.com/';//* 这里改成自己博客地址
$mostactive .= '<li>' . '<a rel="nofollow" href="'. $c_url . '" title="' . $count->comment_author . ' 发言'. $count->cnt . '次"><img src="' . $a . '" alt="' . $count->comment_author . ' ('. $count->cnt . 'comments)" /></a></li>';
}
echo $mostactive;
?>
</ul><script type="text/javascript">$("#loading div").animate({width:"600px"})</script>
这是simple-m主题的sidebar.php的代码。- 分类:
- WordPress
更新时间:
上一篇:下一篇: