
WordPress默认的分页方式,是“« Previous Entries” “Next Entries ”用起来很不方便,大多数博客都是显示页码的,当然WordPress也可以实现。
有两个插件可以实现,分别是Pagebar和Wp-PageNavi,但是我对Wp-PageNavi印象不好,今天介绍Pagebar插件。网上有些教程但都老的掉牙了,今天写个新的。
插件官方网站:http://wordpress.org/extend/plugins/pagebar/
当前最新版本Last Updated: 2009-8-25
使用方法:
1.将解压后的pagebar文件夹传到/wp-content/plugins/,并将pagebar文件夹内的pagebar.css上传到主题的文件夹/wp-content/themes/XXX/下面
2.登录到后台启动插件,默认选项即可。
3.修改需要显示页码的页面一般为index.php、search.php、archive.php等等,找到 如下:
<div class=”navigation”>
<div class=”alignleft”><?php next_posts_link(’« Older Entries’) ?></div> <div class=”alignright”><?php previous_posts_link(’Newer Entries »’) ?></div>
</div>
修改为:
<div class=”navigation”>
<?php if (function_exists(‘wp_pagebar’))
wp_pagebar();
?>
</div>
<div class=”navigation”>
<?php if (function_exists(‘wp_pagebar’))
wp_pagebar();
?>
</div>
- « 上一篇:华北科技学院网络安全重修试卷

发表于 September 13, 2009 2:39 pm
测试
testonly
发表于 September 13, 2009 3:05 pm
欢迎大家来我的小站!