Informasi Posting Lama-Baru biasa muncul kalo entri posting blog sedang diakses. Tapi keliatannya kurang informatif jadi diganti dengan judul.
Sebelum diganti
Sesudah diganti
Pelengkap
Pasang css Font-Awesome dan JQuery.
- <link href='https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css'
rel='stylesheet'/>
- <script src='//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'/>
Kode Skrip Pertama
<b:includable id='nextprev'>
<b:if cond='data:blog.pageType == "item"'>
<div class='blog-pager' id='blog-pager'>
<table border='0' width='100%'>
<tbody>
<tr>
<td align='left' width='33%'><b:if cond='data:newerPageUrl'>
<span id='blog-pager-newer-link'>
<i class='fa fa-angle-double-left'/> <a class='blog-pager-newer-link'
expr:href='data:newerPageUrl' expr:id='data:widget.instanceId +
"_blog-pager-newer-link"' expr:title='data:newerPageTitle'
style='padding-left:5px;'><data:newerPageTitle/></a>
</span>
</b:if></td>
<td align='center' width='33%'><a class='home-link'
expr:href='data:blog.homepageUrl' title='Kembali ke Beranda'><i class='fa
fa-home'/></a></td>
<td align='right' width='33%'><b:if cond='data:olderPageUrl'>
<span id='blog-pager-older-link'>
<a class='blog-pager-older-link' expr:href='data:olderPageUrl'
expr:id='data:widget.instanceId + "_blog-pager-older-link"'
expr:title='data:olderPageTitle'
style='padding-right:5px;'><data:olderPageTitle/></a><i class='fa
fa-angle-double-right'/>
</span>
</b:if></td>
</tr>
</tbody>
</table>
<b:if cond='data:mobileLinkUrl'>
<div class='blog-mobile-link'>
<a expr:href='data:mobileLinkUrl'><data:mobileLinkMsg/></a>
</div>
</b:if>
</div>
</b:if>
<div class='clear'/>
</b:includable>
Kode Skrip Kedua
<!-- blog-pager start -->
<b:if cond='data:blog.pageType == "item"'>
<script type='text/javascript'>
$(document).ready(function(){
var olderLink = $("a.blog-pager-older-link").attr("href");
$("a.blog-pager-older-link").load(olderLink+"
.post-title:first", function() {
var olderLinkTitle = $("a.blog-pager-older-link").text();
$("a.blog-pager-older-link").text(olderLinkTitle);//rgt
});
var newerLink = $("a.blog-pager-newer-link").attr("href");
$("a.blog-pager-newer-link").load(newerLink+"
.post-title:first", function() {
var newerLinkTitle = $("a.blog-pager-newer-link:first").text();
$("a.blog-pager-newer-link").text(newerLinkTitle);
});
});</script>
</b:if>
<!-- blog-pager end -->
Ini hasilnya
Tidak ada komentar:
Posting Komentar