搞了个显示评论者国家、浏览器、操作系统的插件Comment Info Detector
Comment Info Detector这个wordpress插件挺不错的,使用 Comment Info Detector 插件,相比 Reviews Info 的几大优点:
1、一直在更新,从未被超越,最新版本支持 WordPress 2.9.1 ,当然 2.9.2 肯定支持的,都是 2.9+ 的嘛
2、后台设置并且自动插入 国旗、操作系统和浏览器 ,小白用户们无需自己设置,一键解决
3、所有的图片都是本地的,你还可以自定义图标的目录,放上个性化的国旗、浏览器和操作系统的图标
安装使用方法:
1、下载上传并且激活插件
下载地址:http://wordpress.org/extend/plugins/comment-info-detector/ ,上传到 wp-content/plugins
目录后台插件里激活,或者通过后台插件搜索 Comment Info Detector 直接一键安装即可。
2、正确使用方法
作者提供了两种插件使用方法:
① 对 WordPress 老鸟来说,直接插入这段代码到主题文件的 comments.php ,记得放在合适的地方。
<?php if (function_exists(“CID_init”)) { CID_print_comment_flag(); echo ‘ ‘;CID_print_comment_browser(); } ?>
② 对于 WordPress 新手来说,激活插件以后,后台选项会多出一个 Comment Info Detector Option。
在后台调用,这二项打上勾:
“Display Country Flags Automatically” (yes)
“Display Web Browsers and OS Automatically” (yes)
好了,大功告成。
插件挺不错,唯一的遗憾是我这个该死的Mystique主题不能直接支持,琢磨了一下代码才弄懂。在插件options页面里双选yes无效。需在Mystique主题支持函数 (functions.php)里添加上面的代码,而在comments.php里面添加代码没有用。
依旧是这个代码:
<?php if (function_exists(“CID_init”)) { CID_print_comment_flag(); echo ‘ ‘;CID_print_comment_browser(); } ?>
具体位置随个人喜好,我放在了留言日期后面。显示的样式可以在“Country Flag Template:”和“Web Browser and OS Template:”框里面改。默认的既有图标又有文字的模式会很长,如果发现影响页面整体美观,可以去掉了文字只留下图片。这么弄完看上去挺不错。其他主题如果此插件不能直接支持也可以采取类似的方法。
如果发现安装了这个插件会导致网站打开速度变慢,请使用下面的优化方法。
每次调用,页面都会加载一个comment-info-detector.css,这就导致了网站打开速度慢。
解决办法一:
删除插件中的 comment-info-detector.css 文件,会有一定的效果。
解决办法二:
删除这个调用的函数(推荐)
打开 comment-info-detector.php 文件,在大约60-68行之间找到以下代码:
function CID_css() {
echo “\n”.’<!– Generated By Comment Info Detector 1.0.4 – http://hieudt.info/wp-plugins/comment-info-detector –>’.”\n”;
if(@file_exists(TEMPLATEPATH.’/comment-info-detector.css’)) {
echo ‘<link rel=”stylesheet” href=”’.get_stylesheet_directory_uri().’/comment-info-detector.css” type=”text/css” media=”screen” />’.”\n”;
} else {
echo ‘<link rel=”stylesheet” href=”’.WP_PLUGIN_URL.’/comment-info-detector/comment-info-detector.css” type=”text/css” media=”screen” />’.”\n”;
}
}
add_action(‘wp_head’, ‘CID_css’);
立即删除之,你会发现,你的网站轻松了许多,呵呵。

大约10年前
谢谢鸟`
[回复]
大约9年前
测试……
[回复]
大约9年前
测试again
[回复]
大约9年前
测试again~
[回复]
大约9年前
可以发我邮箱一份吗?谢谢啦
[回复]
大约9年前
好也
[回复]
大约7年前
Hi there are using WordPress for your blog platform? I’m new to the blog world but I’m trying to get started and set up my own. Do you need any html coding expertise to make your own blog? Any help would be greatly appreciated!
[回复]