WordPress在单篇文章页内加入上一篇下一篇

原来我使用的“insense-10″主题的时候,没有像K2那自动有文章导航,于是利用了“WP-PageNavi”和在单篇文章页内添加上一篇下一篇来实现导航,具体代码更改如下:

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

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

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

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

<div class=”floatleft”><?php previous_post_link(’? %link’) ?></div>
<div class=”floatright”><?php next_post_link(’%link ?’) ?></div>

3.还要改么,没啦,搞定了! :)

Share and Enjoy:

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Technorati
  • YahooMyWeb
  • Live
  • Google
  • Print this article!

Related Posts

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*