704° 2011160字0条评论

显示文章浏览数

关于显示文章被浏览过几次,有个相应插件叫 WP-PostViews Plus。下载安装,后台设置。然后在 index.phpsingle.php 里找到类似以下与 comment 相关的代码:

<?php comments_popup_link('<span>0 comments</span>', '<span>1 comment</span>', '<span> % comments</span>'); ?>

在前面添加浏览数代码:

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

效果就是先显示浏览数后显示评论数,当然位置也可以调换。

更多此插件应用请参照:官方介绍WordPress 博客文章浏览数统计插件WP-PostViews

EOF
698°
巴士一日游 (4P)
Comments
Write a Comment
点击加载Disqus