WordPress浏览次数统计插件:WP-Postviews

可以说,最好的最流行的WordPress浏览次数统计插件莫过于WP-Postviews,该插件可以统计每篇文章的浏览次数,并且可以获取最受欢迎(浏览次数最多)的文章列表。

WP-Postviews 可以设置统计对象:任何人、匿名访客、已登录用户,可以排除统计蜘蛛爬虫。

最新版的 WP-Postviews 已经支持缓存,即使你使用了 WP Super Cache 等缓存插件缓存,它照样可以正常统计。

wpdaxue.com-201212216

WP-Postviews使用

1.要让你的博客在页面上显示浏览次数,你需要修改你博客当前使用的主题,在主循环中插入以下代码:

<?php if(function_exists('the_views')) { the_views(); } ?>

你可能需要修改 index.php, archive.php, single.php, post.php 或者 page.php等。

2.显示最受欢迎的日志的代码是:

<?php if (function_exists('get_most_viewed')): ?>
   <ul>
      <?php get_most_viewed(); ?>
   </ul>
<?php endif; ?>

3.某个分类和某个 tag 下的最后欢迎日志分别是:get_most_viewed_category()get_most_viewed_tag()

WP-Postviews下载安装

直接在后台搜索 WP-Postviews 在线安装,或者访问官方下载WP-Postviews

如果你懂得修改主题文件,不喜欢使用插件,那你可以看看 WordPress非插件实现文章浏览次数统计

来源:

https://www.wpdaxue.com/wp-postviews.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_32825.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?