文章评分
次,平均分 :
安装步骤
首先从WP-PageNavi的网站上下载插件代码:http://lesterchan.net/wordpress/readme/wp-pagenavi.html
然后解压,将 pagenavi 文件夹上传到/wp-content/plugins中,之后在后台激活WP-PageNavi插件就可以了。
插件配置
打开/wp-content/themes/你的风格目录/index.php,找到:
<span style="margin: 0px; color: #009900; padding: 0px;"><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;"><div</span> <span style="margin: 0px; color: #000066; padding: 0px;">class</span>=<span style="margin: 0px; color: #ff0000; padding: 0px;">"postnav"</span><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;">></span></span>
<span style="margin: 0px; color: #009900; padding: 0px;"><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;"><div</span> <span style="margin: 0px; color: #000066; padding: 0px;">class</span>=<span style="margin: 0px; color: #ff0000; padding: 0px;">"prev"</span><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;">></span></span><span style="margin: 0px; color: #009900; padding: 0px;"><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;"><</span>?php next_posts_link<span style="margin: 0px; color: #66cc66; padding: 0px;">(</span>__<span style="margin: 0px; color: #66cc66; padding: 0px;">(</span><span style="margin: 0px; color: #ff0000; padding: 0px;">'? Previous Entries'</span><span style="margin: 0px; color: #66cc66; padding: 0px;">)</span><span style="margin: 0px; color: #66cc66; padding: 0px;">)</span> ?<span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;">></span></span>
<span style="margin: 0px; color: #009900; padding: 0px;"><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;"></div></span></span> <span style="margin: 0px; color: #009900; padding: 0px;"><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;"><div</span> <span style="margin: 0px; color: #000066; padding: 0px;">class</span>=<span style="margin: 0px; color: #ff0000; padding: 0px;">"next"</span><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;">></span></span><span style="margin: 0px; color: #009900; padding: 0px;"><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;"><</span>?php previous_posts_link<span style="margin: 0px; color: #66cc66; padding: 0px;">(</span>__<span style="margin: 0px; color: #66cc66; padding: 0px;">(</span><span style="margin: 0px; color: #ff0000; padding: 0px;">'Next Entries ?'</span><span style="margin: 0px; color: #66cc66; padding: 0px;">)</span><span style="margin: 0px; color: #66cc66; padding: 0px;">)</span> ?<span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;">></span></span><span style="margin: 0px; color: #009900; padding: 0px;"><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;"></div></span></span> <span style="margin: 0px; color: #009900; padding: 0px;"><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;"></div></span></span>
替换为:
<span style="margin: 0px; color: #009900; padding: 0px;"><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;"><div</span> <span style="margin: 0px; color: #000066; padding: 0px;">class</span>=<span style="margin: 0px; color: #ff0000; padding: 0px;">"postnav"</span><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;">></span></span>
<span style="margin: 0px; color: #009900; padding: 0px;"><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;"><</span>?php if<span style="margin: 0px; color: #66cc66; padding: 0px;">(</span>function_exists<span style="margin: 0px; color: #66cc66; padding: 0px;">(</span><span style="margin: 0px; color: #ff0000; padding: 0px;">'wp_pagenavi'</span><span style="margin: 0px; color: #66cc66; padding: 0px;">)</span><span style="margin: 0px; color: #66cc66; padding: 0px;">)</span><span style="margin: 0px; color: #66cc66; padding: 0px;">{</span> wp_pagenavi<span style="margin: 0px; color: #66cc66; padding: 0px;">(</span><span style="margin: 0px; color: #66cc66; padding: 0px;">)</span>; <span style="margin: 0px; color: #66cc66; padding: 0px;">}</span> else <span style="margin: 0px; color: #66cc66; padding: 0px;">{</span> ?<span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;">></span></span>
<span style="margin: 0px; color: #009900; padding: 0px;"><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;"><div</span> <span style="margin: 0px; color: #000066; padding: 0px;">class</span>=<span style="margin: 0px; color: #ff0000; padding: 0px;">"prev"</span><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;">></span></span><span style="margin: 0px; color: #009900; padding: 0px;"><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;"><</span>?php next_posts_link<span style="margin: 0px; color: #66cc66; padding: 0px;">(</span>__<span style="margin: 0px; color: #66cc66; padding: 0px;">(</span><span style="margin: 0px; color: #ff0000; padding: 0px;">'? Previous Entries'</span><span style="margin: 0px; color: #66cc66; padding: 0px;">)</span><span style="margin: 0px; color: #66cc66; padding: 0px;">)</span> ?<span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;">></span></span><span style="margin: 0px; color: #009900; padding: 0px;"><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;"></div></span></span>
<span style="margin: 0px; color: #009900; padding: 0px;"><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;"><div</span> <span style="margin: 0px; color: #000066; padding: 0px;">class</span>=<span style="margin: 0px; color: #ff0000; padding: 0px;">"next"</span><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;">></span></span><span style="margin: 0px; color: #009900; padding: 0px;"><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;"><</span>?php previous_posts_link<span style="margin: 0px; color: #66cc66; padding: 0px;">(</span>__<span style="margin: 0px; color: #66cc66; padding: 0px;">(</span><span style="margin: 0px; color: #ff0000; padding: 0px;">'Next Entries ?'</span><span style="margin: 0px; color: #66cc66; padding: 0px;">)</span><span style="margin: 0px; color: #66cc66; padding: 0px;">)</span> ?<span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;">></span></span><span style="margin: 0px; color: #009900; padding: 0px;"><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;"></div></span></span> <span style="margin: 0px; color: #009900; padding: 0px;"><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;"><</span>?php <span style="margin: 0px; color: #66cc66; padding: 0px;">}</span> ?<span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;">></span></span>
<span style="margin: 0px; color: #009900; padding: 0px;"><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;"></div></span></span>
?
??? 如果你的模板找不到原始的分页代码,就直接添加吧!
?
<span style="margin: 0px; color: #009900; padding: 0px;"><span style="font-weight: bold; margin: 0px; color: #000000; padding: 0px;"><!------------------------WP-PageNavi 分页开始-------------------------------> <div> <?php if(function_exists('wp_pagenavi')){ wp_pagenavi(); } else { ?> <div><?php next_posts_link(__('? Previous Entries')) ?></div> <div><?php previous_posts_link(__('Next Entries ?')) ?></div> <?php } ?> </div> </div> <!------------------------WP-PageNavi 分页结束-------------------------------> <?php get_sidebar(); ?> <div></div><!-- 我是空--> <?php get_footer(); ?></span></span>
?
解释一下:
<?php get_sidebar(); ?>? 侧边栏
<?php get_footer(); ?>??? 底部栏
?
在这上面写上分页代码即可
除特别注明外,本站所有文章均为牵挂的家原创,转载请注明出处来自http://qinai.net/10.html
暂无评论