wordpress文章计数插件 WP-PostViews 1.30 Readme

六 11th, 2008  ,
0

Comments

  1. Open wp-content/themes/<YOUR THEME NAME>/index.phpYou may place it in single.php, post.php or page.php also.
  2. Find:

    <?php while (have_posts()) : the_post(); ?>

  3. Add Anywhere Below It:

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

  4. Go to ‘WP-Admin -> Settings -> Post Views’ to configure the plugin.

View Stats (With Widgets)

  1. Activate WP-PostViews Widget Plugin
  2. Go to ‘WP-Admin -> Design -> Widgets
  3. To Display Most Viewed Post
  4. You can add the Most Viewed Widget by clicking on the ‘Add’ link besides it.
  5. After adding, you can configure the Most Viewed Widget by clicking on the ‘Edit’ link besides it.
  6. Click ‘Save Changes’

View Stats (Outside WP Loop)

  • To Display Most Viewed Post
  • Use:

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

    The first value you pass in is what you want to get, ‘post’, ‘page’ or ‘both’.
    The second value you pass in is the maximum number of post you want to get.

    Default: get_most_viewed(’both’, 10);

  • To Display Most Viewed Post For A Category
  • Use:

    <?php if (function_exists(’get_most_viewed_category’)): ?>
       <ul>
          <?php get_most_viewed_category(); ?>
       </ul>
    <?php endif; ?>

    The first value you pass in is the category id.
    The second value you pass in is what you want to get, ‘post’, ‘page’ or ‘both’.
    The third value you pass in is the maximum number of post you want to get.

    Default: get_most_viewed_category(1, ‘both’, 10);

来自: http://lesterchan.net/wordpress/readme/wp-postviews.html

文章访问计数插件有三个,分别是WP-PostViews、WP-PostViews Plus和WP-PostViews JS。其中WP-PostViews Plus是国人制作的插件,功能比较单一,不停的刷新就会取得很高的访问数,所以不用。而WP-PostViews JS则是将WP-PostViews改成了JS版本,主要是为了兼容WP-Cache等静态化插件,因为WP-PostViews 在使用WP-Cache等静态插件的情况下会停止计数。但WP-PostViews JS不支持首页和目录页的计数,而且对任何访问者包括作者本人的访问也技术,且使用较为负责,所以最终选择了WP-PostViews。

WP-PostViews插件介绍

WP-PostViews插件由 GaMerZ 开发,主要功能是实现文章阅读数统计、侧边栏 Widget 以及显示最受欢迎(阅读数最多)文章、某分类下最受欢迎(阅读数最多)文章等功能。

WP-PostViews插件使用方法

1.页面使用

下载安装插件之后,在blog中你想要展现统计数的地方插入以下代码即可。

  1. < ?php if(function_exists(’the_views’)) {the_views();} ?>

2.widget使用
对于支持widget的wordpress的主题来说,激活WP-PostViews Widget之后,拖拽到侧边栏合适的位置即可,对于不知道widget的主题,使用以下语言进行调用。

  1. < ?php if (function_exists(’get_most_viewed’)): ?>   
  2.    < ?php get_most_viewed(); ?>   
  3. < ?php endif; ?>

下载及说明

下载页面

目前wp-postviews的最新版本是1.20,完全支持wordpress2.5.1,但安装之后会提示WP-PostViews Widget有最新版本2.20可升级,因为几次自动升级都出错,不建议升级。

来自:Wordpress插件推荐:计数插件WP-PostViews

声明: 本站遵循 署名-非商业性使用-相同方式共享 3.0共享协议.转载请注明转自 http://www.amakura.cn/blog/index.php/archives/17  【天仓零's   blog:无限轮回】

Tags: ,

Leave a Reply