WP-PostViews统计出错

我觉得WP-PostViews统计插件WordPress用得最多的统计插件,但是有的主题使用这个插件的时候,会在统计输出时,在原来的记数前面加“1”,比如“736”次访问量,结果显示的是“1736”次。这个很不对劲,而且最高数位显示的都是“1”。

WP-PostViews统计出错

解决这个很容易,在“http://你的域名/wp-admin/plugin-editor.php?file=wp-postviews/wp-postviews.php”编辑wp-postviews.php文件,将

$output = $prefix.str_replace('%VIEW_COUNT%', number_format_i18n($post_views), $views_options['template']).$postfix;

替换为

$output =  "".str_replace('%VIEW_COUNT%', number_format_i18n($post_views), $views_options['template'])."";

如此这般,前台就会显示正常了。