查看文章 |
插件名称: WP-PostViews1.20作者: Lester ‘GaMerZ’ Chan 下载地址: 演示地址:http://www.zhouyun.net/blog
二、使用方法 (一)一般应用
<?php while (have_posts()) : the_post(); ?>
3.将下面的语句添加到如何需要的地方 <?php if(function_exists('the_views')) { the_views(); } ?>
(UNNAMED 主题需在theloop.php文件里查找添加) 4. 登录“WP-Admin -> Options -> Post Views”可以配置该插件 (二)侧边栏 Widget 使用 1. 激活 “WP-PostViews Widget” 插件 (三)调用使用 1、显示最受欢迎(阅读次数最多)文章,使用下面语句 <?php if (function_exists('get_most_viewed')): ?>
<?php get_most_viewed(); ?> <?php endif; ?> 第一个值是你想得到的列表的类型是“文章”或“页面”或“两者都有”,如“’pos”、“page”或者“both” 默认的是这样的: get_most_viewed('both', 10); //获取被阅读次数最多的10篇文章和页面
2、显示某个分类下最受欢迎(阅读次数最多)文章 <?php if (function_exists('get_most_viewed_category')): ?>
<?php get_most_viewed_category(); ?> <?php endif; ?> 第一个值是分类目录的ID 默认是这样的: get_most_viewed_category(1, 'both', 10); //ID为1的目录下阅读最多的10篇文章和页面
四、升级方法 1. 禁用 WP-PostViews 插件 |