WordPress浏览次数统计插件:WP-Postviews使用

WP-Postviews使用

1.要让你的博客在页面上显示浏览次数,你需要修改你博客当前使用的主题,在主循环中插入以下代码:

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

你可能需要修改 index.phparchive.phpsingle.phppost.php 或者 page.php等。

2.显示最受欢迎的日志的代码是:

1
2
3
4
5
<?php if (function_exists('get_most_viewed')): ?>
   <ul>
      <?php get_most_viewed(); ?>
   </ul>
<?php endif; ?>

3.某个分类和某个 tag 下的最后欢迎日志分别是:get_most_viewed_category() 和get_most_viewed_tag()

posted @ 2018-01-15 17:22  绿林豪士  阅读(986)  评论(0编辑  收藏  举报