Loper主题替换评论引用通告功能,记得以前Loper主题替换评论引用通告功能是有用的,到了最新WP版本就开始无效果了,所以我就把这个无用的功能替换掉,增加其他实用的功能进去!今天我把Loper主题替换评论引用通告功能方法分享给大家,请看以下操作!
替换前的效果图!
1.登陆你的后台管理,选择【外观】-【编辑】-【loper: 评论 (comments.php)?】
2.登陆你的后台管理,选择【外观】-【编辑】-【loper: guestcomments.php 】
【loper: 评论 (comments.php)?】和【loper: guestcomments.php 】里面都要修改!
直接搜索下面全部代码:
<?php if($comments) : ?><!-- 如果有评论 -->
<div class="commentsorping">
<div class="commentsays"><?php comments_number('暂时没有回复', '现在只有1个回复', '已经有%个回复' );?></div>
<div class="commentpart"><span class="commentparttri"></span>Comment<?php echo (' (' . (count($comments)-count($trackbacks)) . ')'); ?></div>
<div class="pingpart"><span class="pingparttri"></span>Trackbacks<?php echo (' (' . count($trackbacks) . ')');?></div>
</div>
以上的全部代码替换为下面全部代码:
<?php if($comments) : ?><!-- 如果有评论 -->
<div id="commnents" class="commentsorping">
<div class="commentsays"><?php comments_number('暂时没有回复', '现在只有1个回复', '已经有%个回复' );?></div>
<div class="commentpart"><span class="commentparttri"></span>
评论<?php echo (' (' . (count($comments)-count($trackbacks)) . ')'); ?></div>
<div class="commentpart"><span class="commentparttri"></span>
<?php $my_email = get_bloginfo ( 'admin_email' );
$str = "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = $post->ID
AND comment_approved = '1' AND comment_type = '' AND comment_author_email";
$count_h = $wpdb->get_var("$str = '$my_email'");
echo "博主 (", $count_h, ")"; ?></div>
<div class="commentpart"><span class="commentparttri"></span>
<?php $my_email = get_bloginfo ( 'admin_email' );
$str = "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = $post->ID
AND comment_approved = '1' AND comment_type = '' AND comment_author_email";
$count_v = $wpdb->get_var("$str != '$my_email'");
echo "访客 (", $count_v, ")"; ?></div>
</div>
替换后的效果图!
提示:评论引用通告就是Trackbacks 这个功能,个人感觉没用!
提示:我替换它为统计访客评论几次,博主回复几次,这页共评论几次!

版权声明:本站原创文章,于2016年10月1日,由 拽立网 发表,共 1704 字。
打赏



ID : 牛奶君
享你所想,享你所爱!分类目录 · Categories
最新文章 · Recent Posts
随机文章 · Random Posts
最新评论 · Recent Comments
友情链接 · Links
博客统计 · Blog statistics