介绍 |
Wp-Postviews中文插件是一款可以帮助统计浏览次数浏览量的优秀插件,WordPress浏览次数统计插件:WP-Postviews为中文最新版本,马上下载使用吧。  基本简介 可以说,最好的最流行的WordPress浏览次数统计插件莫过于WP-Postviews,该插件可以统计每篇文章的浏览次数,并且可以获取最受欢迎(浏览次数最多)的文章列表。 WP-Postviews 可以设置统计对象:任何人、匿名访客、已登录用户,可以排除统计蜘蛛爬虫。 最新版的 WP-Postviews 已经支持缓存,即使你使用了 WP Super Cache 等缓存插件缓存,它照样可以正常统计。 使用方法 1、打开wp-content/themes/<你的主题名称>/index.php 你可以把代码放到single.php,post.php 或 page.php 中。 2、找到:  <?php while (have_posts()) : the_post(); ?> 3、在合适的地方加入:  <?php if(function_exists(’the_views’)) { the_views(); } ?> 打开‘设置 -> Post Views’ 设定插件的参数。 查看状态(使用Widget): 启用 WP-PostViews Widget 插件 打开 ‘外观 -> Widgets‘ 将Most Viewed Widget 拖放到 侧边栏 您可以通过配置按钮配置 Most Viewed Widget插件。 点击“保存更改” ·显示统计: 显示查看最多的 ·用法:  <?php if (function_exists('get_most_viewed')): ?> <?php get_most_viewed(); ?> <?php endif; ?> ·第一个参数:展示统计的类型’post’(日志),’page’(页面)或者’both’(两者都显示) 第二个参数 :需要展示的数量 ·缺省情况下:get_most_viewed(‘both’, 10); 显示某个分类中被查看最多的文章或者页面 ·用法:  <?php if (function_exists('get_most_viewed_category')): ?> <?php get_most_viewed_category(); ?> <?php endif; ?> ·第一个参数:分类的ID,在“管理-》分类”中可以看到。 第二个参数:展示统计的类型’post’(日志),’page’(页面)或者’both’(两者都显示) 第三个参数:需要展示的数量 ·缺省情况下:get_most_viewed_category(1, ‘both’, 10); 截图展示   |