28 Oktober 2020

Perombakan Simple Simply Simple : Mengganti Posting Lama-Baru Jadi Judul Entri Posting Blog

Informasi Posting Lama-Baru biasa muncul kalo entri posting blog sedang diakses. Tapi keliatannya kurang informatif jadi diganti dengan judul.

Sebelum diganti

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 == &quot;item&quot;'>
<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 + &quot;_blog-pager-newer-link&quot;' 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 + &quot;_blog-pager-older-link&quot;' 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 == &quot;item&quot;'>
<script type='text/javascript'>
$(document).ready(function(){
var olderLink = $(&quot;a.blog-pager-older-link&quot;).attr(&quot;href&quot;);
$(&quot;a.blog-pager-older-link&quot;).load(olderLink+&quot; .post-title:first&quot;, function() {
var olderLinkTitle = $(&quot;a.blog-pager-older-link&quot;).text();
$(&quot;a.blog-pager-older-link&quot;).text(olderLinkTitle);//rgt
});
var newerLink = $(&quot;a.blog-pager-newer-link&quot;).attr(&quot;href&quot;);
$(&quot;a.blog-pager-newer-link&quot;).load(newerLink+&quot; .post-title:first&quot;, function() {
var newerLinkTitle = $(&quot;a.blog-pager-newer-link:first&quot;).text();
$(&quot;a.blog-pager-newer-link&quot;).text(newerLinkTitle);
});
});</script>
</b:if>
<!-- blog-pager end -->

Ini hasilnya
Sesudah diganti

Tidak ada komentar:

Anekatrium-Nusaresearch Entri yang populer Trik Nambang Bitcoin Tiap Jam

Posting Komentar