巫冰吧 关注:13贴子:384
  • 1回复贴,共1

WordPress :在文章日志页左右两侧添加上一篇、下一篇按钮

只看楼主收藏回复

操作过程 1.在主题的single.php文件中添加以下代码:
<div class=“postnavigation”>
<span class=“left”><?php if (get_next_post()) { next_post_link(‘%link’,'&lt;’); } else { echo “<a href=’http://coolwb.com’>&lt;</a>”; }; ?></span>
<span class=“right”><?php if (get_previous_post()) { previous_post_link(‘%link’,'&gt;’);} else { echo “<a href=’http://coolwb.com’>&gt;</a>”; }; ?></span></div>
2.在样式css文件中添加:
/* Post navigation */
.postnavigation .left { position:fixed; left:45%; margin-left:-550px; top:45%;z-index:999;}
.postnavigation .right { position:fixed; right:45%; margin-right:-550px; top:45%;z-index:999;}
.postnavigation a{ color:#ddd; font-size:80px; font-family: Georgia, “Times New Roman”, Times, serif;text-decoration:none;}
.postnavigation a:hover{color:#666;text-decoration:none;}


1楼2013-04-27 23:58回复
    妹子,找一男友
    Q我:1㊂O㊇4㊇96O6
    制豇曷


    来自手机贴吧2楼2013-04-28 03:50
    回复