为了达到这个目的搜索了

很多WordPress分页插件

可能是关键词不对吧,结果用WordPress在单篇文章页内加入上一页下一页找到我所需要的了

其实很多主题在设计的时候都已经加入了这个功能,就是在你阅读一篇文章的这个页面页头或是页尾都链接着上一篇和下一篇。作用也是不言而喻的,何必也不用解释多少!WordPress在基本语法里已经有了这个的支持,但是还有很多主题在设计的时候没有注意这样的细节。我的博客的更换主题频率是很高的,所以也就摸索了一些这方面的技巧。下面教大家怎么做!

1.先打开style.css,在最底端输入:

.floatleft {
float:left;
}
.floatright {
float:right;
}

这个意思就是把上一篇和下一篇同行并且分列左右两端。

2.将下列加入到single.php(也就是单篇文章页面)的合适位置。

<div class=”floatleft”><?php previous_post_link(‘&laquo; %link’) ?></div>
<div class=”floatright”><?php next_post_link(‘%link &raquo;’) ?></div>

3.搞定!

本文来自:http://www.hebine.net/blog/archives/234.html

相关文章

Tagged with:
 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Set your Twitter account name in your settings to use the TwitterBar Section.