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()

相关文章:

  • 2022-02-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-23
  • 2021-09-19
  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-05
相关资源
相似解决方案