- A+
所属分类:WordPress
WordPress文章浏览数统计插件是WP博客必备的,推荐一款功能强大的插件:WP-Postviews,新手站长网来说说WP-Postviews的设置以及使用方法:
WP-Postviews设置

WP-Postviews设置
设置统计对象(Count Views From)可以选择:任何人(Everyone)、访客(Guests Only)或者注册用户(Registered Users Only),可以排除蜘蛛爬虫(Exclude Bot Views)。
WP-Postviews使用
使用方法一:在页面调用浏览数
在WordPress文章页或者页面调用浏览数,需要在当前博客的主循环中加入以下代码:
1 |
<?php if(function_exists('the_views')) { the_views(); } ?> |
一般需要加入的主题模板页为:index.php, archive.php, single.php, post.php 或者 page.php等。
使用方法二:调用最受欢迎的文章
显示最受欢迎的文章的代码是:
1 2 3 4 5 |
<?php if (function_exists('get_most_viewed')): ?> <ul> <?php get_most_viewed(); ?> </ul> <?php endif; ?> |
使用方法三:调用某个人类或者标签下最受欢迎的文章
某个分类和某个tag下的最受欢迎文章分别是:get_most_viewed_category()
和get_most_viewed_tag()
云服务器价格出炉,价格很低:
- 云服务器特价:阿里云服务器特惠57元起(全网最低价)
- 阿里云:阿里云代金券一键领取中...
- 腾讯云:腾讯云服务器秒杀特价88元一年起