wp-postviews——wordpress文章点击排行插件
2009-07-24 17:33
806 查看
wp-postviews——wordpress文章点击排行插件
一、插件介绍
该插件实现的功能是统计某篇文章被阅读次数并且可以实现侧边栏 Widget 以及显示最受欢迎(阅读数最多)文章、某分类下最受欢迎(阅读数最多)文章等功能。
二、安装方法
1. 将解压得到的 postviews 文件夹上传到 /wp-content/plugins 文件夹中
2. 激活 WP-PostViews 插件,然后可以去 Options 中设置
三、使用方法
(一)一般应用
1. 修改 /wp-content/themes/<YOUR THEME NAME>/index.php(single.php, post.php 或 page.php)
2. 如果修改 index.php 找到<?php while (have_posts()) : the_post(); ?>
复制代码3. 将下面的语句添加到需要显示的地方<?php if(function_exists('the_views')) { the_views(); } ?>
复制代码4. 登录“WP-Admin -> Options -> Post Views”可以配置该插件
Count Views From 设置被统计的用户群
Views Template 该插件显示样式
(二)侧边栏 Widget 使用
1. 激活 “WP-PostViews Widget” 插件
2. 登录 “’WP-Admin -> Presentation -> Widgets”
3. 为了显示“Most Viewed Post(最受欢迎文章)”拖曳(Drag)“Most Viewed Widget”到侧边栏
4. 可以点击配置图标对 “Most Viewed Widget” 进行配置,然后点击“Save changes”保存
(三)调用使用
1、显示最受欢迎(阅读次数最多)文章,使用下面语句<?php if (function_exists('get_most_viewed')): ?>
<?php get_most_viewed('both', 20); ?>
<?php endif; ?>
复制代码第一个值是你想得到的列表的类型是“文章”或“页面”或“两者都有”,如“’pos”、“page”或者“both”
第二个值是你想得到的列表的对象个数
get_most_viewed('both', 20); 获取被阅读次数最多的10篇文章
例如hellotu.com侧边调用方式: <li id="categories-1">
<h2>最受欢迎20个QQ表情</h2>
<ul>
<?php if (function_exists('get_most_viewed')): ?>
<?php get_most_viewed('both', 20); ?>
<?php endif; ?>
</ul> 香港公司注册 </li>
复制代码2、显示某个分类下最受欢迎(阅读次数最多)文章<?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); ID为1的目录下阅读最多的10篇文章和页面
四、升级方法
1. 禁用 WP-PostViews 插件
2. 上传并覆盖 /wp-content/plugins 中的 postviews 文件夹
3. 删除 postviews.php 文件
4. 激活 WP-PostViews 插件
一、插件介绍
该插件实现的功能是统计某篇文章被阅读次数并且可以实现侧边栏 Widget 以及显示最受欢迎(阅读数最多)文章、某分类下最受欢迎(阅读数最多)文章等功能。
二、安装方法
1. 将解压得到的 postviews 文件夹上传到 /wp-content/plugins 文件夹中
2. 激活 WP-PostViews 插件,然后可以去 Options 中设置
三、使用方法
(一)一般应用
1. 修改 /wp-content/themes/<YOUR THEME NAME>/index.php(single.php, post.php 或 page.php)
2. 如果修改 index.php 找到<?php while (have_posts()) : the_post(); ?>
复制代码3. 将下面的语句添加到需要显示的地方<?php if(function_exists('the_views')) { the_views(); } ?>
复制代码4. 登录“WP-Admin -> Options -> Post Views”可以配置该插件
Count Views From 设置被统计的用户群
Views Template 该插件显示样式
(二)侧边栏 Widget 使用
1. 激活 “WP-PostViews Widget” 插件
2. 登录 “’WP-Admin -> Presentation -> Widgets”
3. 为了显示“Most Viewed Post(最受欢迎文章)”拖曳(Drag)“Most Viewed Widget”到侧边栏
4. 可以点击配置图标对 “Most Viewed Widget” 进行配置,然后点击“Save changes”保存
(三)调用使用
1、显示最受欢迎(阅读次数最多)文章,使用下面语句<?php if (function_exists('get_most_viewed')): ?>
<?php get_most_viewed('both', 20); ?>
<?php endif; ?>
复制代码第一个值是你想得到的列表的类型是“文章”或“页面”或“两者都有”,如“’pos”、“page”或者“both”
第二个值是你想得到的列表的对象个数
get_most_viewed('both', 20); 获取被阅读次数最多的10篇文章
例如hellotu.com侧边调用方式: <li id="categories-1">
<h2>最受欢迎20个QQ表情</h2>
<ul>
<?php if (function_exists('get_most_viewed')): ?>
<?php get_most_viewed('both', 20); ?>
<?php endif; ?>
</ul> 香港公司注册 </li>
复制代码2、显示某个分类下最受欢迎(阅读次数最多)文章<?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); ID为1的目录下阅读最多的10篇文章和页面
四、升级方法
1. 禁用 WP-PostViews 插件
2. 上传并覆盖 /wp-content/plugins 中的 postviews 文件夹
3. 删除 postviews.php 文件
4. 激活 WP-PostViews 插件
相关文章推荐
- wp-postviews文章浏览次数与点击排行详解
- 实现wordpress文章浏览次数统计—使用WP-Postviews插件
- WORDPRESS博客文章点击统计插件 WP-POSTVIEWS安装使用详细介绍
- WordPress添加WP-PostViews插件显示访问量
- 为Wordpress安装WP-PostViews插件
- WP-PostViews Plus插件显示博客文章浏览数
- 解决wordpress 浏览次数位置调整问题(wp postviews 插入代码)
- wordpress 文章阅读统计插件之WP-PostViews
- WordPress使用wp-autopost插件采集储存于七牛云出错显示incorrect zone, please use up-z1.qiniu.com的解决办法
- wordpress 使用wp-postviews统计文章浏览次数和显示热门文章排行的方法
- WordPress post-views插件跨站请求伪造漏洞
- WordPress主题制作教程10:添加文章类型插件Custom Post Type UI
- WordPress 前端投稿/编辑发表文章插件 DJD Site Post(支持游客和已注册用户)汉化版 免费下载
- WordPress非插件版post_view(文章点击量统计代码)
- WordPress Feedweb插件‘wp_post_id’参数跨站脚本漏洞
- inove主题通过wp-postviews插件的方法设置在主页及文章页设置浏览次数
- WP Super Cache插件不会影响Wordpress的文章更新
- WordPress非插件版post_view(文章点击量统计代码)
- WordPress非插件版post_view实现文章点击量统计功能
- 不用任何插件实现WordPress文章点击数