inove主题 wp-postviews 后续完善.显示阅读次数

作者:matrix 被围观: 5,604 次 发布时间:2011-07-16 分类:Wordpress 兼容并蓄 | 一条评论 »

这是一个创建于 4639 天前的主题,其中的信息可能已经有所发展或是发生改变。

1、安装 wp-postviews 插件,至于插件的安装,相信各位站长肯定会安装,所以在这儿就不罗嗦了;

2、在文章里显示点击次数
编辑inove主题下的 single.php 文件,找到如下代码:

<?php edit_post_link(__('Edit', 'inove'), '<span>', '</span>'); ?>

<?php if ($comments || comments_open()) : ?>

<span><a href="#respond"><?php _e('Leave a comment', 'inove'); ?></a></span>

<span><a href="#comments"><?php _e('Go to comments', 'inove'); ?></a></span>

在下面添加

 <span> <a href ><?php if(function_exists('the_views')) { the_views(); } ?></a></span>

在代码里加了 span 和 空link ,可根据喜好进行修改。

3、在首页显示每篇文章点击次数
编辑inove主题下的 index.php 文件,找到如下代码:

 <?php if ($options['author']) : ?><span><?php the_author_posts_link(); ?></span><?php endif; ?>

<?php edit_post_link(__('Edit', 'inove'), '<span>', '</span>'); ?>

<span><?php comments_popup_link(__('No comments', 'inove'), __('1 comment', 'inove'), __('% comments', 'inove'), '', __('Comments off', 'inove')); ?></span>

在下面添加:

 <span> <a href ><?php if(function_exists('the_views')) { the_views(); } ?></a></span>

在这儿代码里同样加了 span 和 空link ,根据自己喜好进行修改即可。

4、进入 WordPress 后台,将 wp-postviews 插件启用,并到 设置 里,进入 PostView 选项,进行相关的修改即可。

5、如果想在 归档 中也想显示每篇文章的点击情况,可以如下操作:
在inove主题下编辑 archive.php 文件,找到如下代码:

<?php if ($options['author']) : ?><span><?php the_author_posts_link(); ?></span><?php endif; ?>

<?php edit_post_link(__('Edit', 'inove'), '<span>', '</span>'); ?>

<span><?php comments_popup_link(__('No comments', 'inove'), __('1 comment', 'inove'), __('% comments', 'inove'), '', __('Comments off', 'inove')); ?></span>

在下面添加:

<span> <a href ><?php if(function_exists('the_views')) { the_views(); } ?></a></span>

修改完后,测试下效果如何。
—————————————————————————————————————————————————
后记:
还可以在侧边栏显示 热门文章 之类的效果,到后台的 外观 里,进入 小工具 选项,将 Views 工具放到 north_sidebar 中,最后设置下相关参数即可。
更多的配置方法,可以参照 官方文档

来自: http://www.edward-han.com/115.html

以上代码内容可能有复制遗漏的问题,本人copy也是是以备后用。 若使用中有问题建议点击原文连接

其他文章:
本文固定链接:https://www.hhtjim.com/inove-theme-wp-postviews-follow-up-perfect-show-views.html
matrix
本文章由 matrix 于2011年07月16日发布在Wordpress, 兼容并蓄分类下,目前没有通告,你可以至底部留下评论。
转载请注明:inove主题 wp-postviews 后续完善.显示阅读次数-HHTjim'S 部落格
关键字:, ,

有1条评论 »

  1. windows 7 key windows 7 key 2011-9-21 6:04:48 +0800#1

    It's the best time to make some plans for the future and it's time to be happy. I have read this post and if I could I wish to suggest you some interesting things or advice. Perhaps you can write next articles referring to this article. I desire to read even more things about it!

添加新评论 »

 🙈 😱 😂 😛 😭 😳 😀 😆 👿 😉 😯 😮 😕 😎 😐 😥 😡 😈 💡

插入图片

NOTICE: You should type some Chinese word (like “你好”) in your comment to pass the spam-check, thanks for your patience!