16 10 月 Bridge – 建立”上下篇文章” 連結

問題 不是 問題
根據官方給的方法有三個步驟: (其中第三點是自己補正的)
install bridge-child theme
編輯 bridge\templates\blog_single-loop.php
佈景外觀–>自訂–>附加的CSS
步驟一 - install bridge-child theme
其實我不知道為何要安裝這個子佈景,既然官方提了就裝吧!
步驟二 - 編輯 bridge\templates\blog_single-loop.php
於文末加上PHP語法如下: (所有要顯示的格式或顏色都在此設定)

<div class=”single_blog_post_navigation”>
<div class=”single_blog_post_prev”>
<?php
$prev_html_info = ”;
if(get_previous_post() != “”){
$prev_post = get_previous_post();
$prev_html_info = get_the_title($prev_post);
}
$prev_html = ‘<font size=”3″ >’.'<i class=”fa fa-angle-double-left”></i>’.’ 上一篇      ’.'</font>’.'<font size=”5″ >’.$prev_html_info.'</font>’;
previous_post_link(‘%link’, $prev_html);
?>
</div>
<div class=”single_blog_post_next”>
<?php
$next_html_info = ”;
if(get_next_post() != “”){
$next_post = get_next_post();
$next_html_info = get_the_title($next_post);
}
$next_html = ‘<font size=”5″ >’.$next_html_info.'</font>’.'<font size=”3″ >’.’      下一篇 ‘.'<i class=”fa fa-angle-double-right”></i>’.'</font>’;
next_post_link(‘%link’,$next_html);
?>
</div>
<div class=”clearfix”></div>
</div>
步驟三 - 外觀-->自訂-->附加的CSS

.single_blog_post_prev {
float: left !important;
}
.single_blog_post_prev {
display: inline-block !important;
}
.single_blog_post_prev a i {
font-size: 18px !important;
margin-right: 10px !important;
}
.single_blog_post_next {
float: right !important;
}
.single_blog_post_next a i {
font-size: 18px !important;
margin-left: 10px !important;
}
.single_blog_post_navigation {
margin: 20px 0px !important;
}
花了點時間研究,終於完成啦!

近期留言