Membuat Page Navigation Fast Load


Membuat Page Navigation Fast Load - Page Navigation atau navigasi halaman berfungsi untuk mempermudah pengunjung menjelajahi blog kita dan melihat halaman perhalaman.
Bagi pengguna Wordpress tentunya sudah tidak asing dengan page navigation. Bagi pengguna Blogger / Blogspot, harus menyisipkan kode javascript. Biasanya blog pager dengan nomor ini membuat kecepatan loading sebuah blog tersebut lebih lambat karena javascript nya diletakkan di external link. Untuk membuatnya lebih cepat, letakkan saja javascriptnya ke template blog. Berikut tutorialnya

Membuat Page Navigation Fast Load :
1. Letakkan Kode berikut tepat di atas ]]</b:skin>
#blog-pager {text-align: center;}.showpageArea {overflow: hidden;padding: 5px 0;}.showpageOf {background: #eee;padding: 2px 5px;margin-right: 5px;}.showpagePoint {background: #00a3ff;color: #fff;padding: 2px;margin-right:3px;}.showpageNum a {background: #eee;padding: 2px 4px;margin-right:3px;color: #000;}.showpage a {background: #eee;padding: 2px 4px;margin: 0;color: #000;margin-left: 3px;}
2. Letakkan kode berikut tepat di atas </body>
<b:if cond='data:blog.pageType != &quot;item&quot;'>
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<script type='text/javascript'>
var pageCount=4;
var displayPageNum=3;
var upPageWord =&#39;&#171;&#39;;
var downPageWord =&#39;&#187;&#39;;
</script>
  <script type='text/javascript'>
//<![CDATA[
function showpageCount(json){var thisUrl=home_page_url;var htmlMap=new Array();var thisNum=1;var postNum=1;var itemCount=0;var fFlag=0;var eFlag=0;var html='';var upPageHtml='';var downPageHtml='';for(var i=0,post;post=json.feed.entry[i];i++){var timestamp1=post.published.$t.substring(0,19)+post.published.$t.substring(23,29);timestamp=encodeURIComponent(timestamp1);var title=post.title.$t;if(title!=''){if(itemCount==0||(itemCount%pageCount==(pageCount-1))){if(thisUrl.indexOf(timestamp)!=-1){thisNum=postNum}if(title!='')postNum++;htmlMap[htmlMap.length]='/search?updated-max='+timestamp+'&max-results='+pageCount}}itemCount++}for(var p=0;p<htmlMap.length;p++){if(p>=(thisNum-displayPageNum-1)&&p<(thisNum+displayPageNum)){if(fFlag==0&&p==thisNum-2){if(thisNum==2){upPageHtml='<span class="showpage"><a href="/">'+upPageWord+'</a></span>'}else{upPageHtml='<span class="showpage"><a href="'+htmlMap[p]+'">'+upPageWord+'</a></span>'}fFlag++}if(p==(thisNum-1)){html+='<span class="showpagePoint">'+thisNum+'</span>'}else{if(p==0){html+='<span class="showpageNum"><a href="/">1</a></span>'}else{html+='<span class="showpageNum"><a href="'+htmlMap[p]+'">'+(p+1)+'</a></span>'}}if(eFlag==0&&p==thisNum){downPageHtml='<span class="showpage"> <a href="'+htmlMap[p]+'">'+downPageWord+'</a></span>';eFlag++}}}if(thisNum>1){html=''+upPageHtml+' '+html+' '}html='<div class="showpageArea"><span style="COLOR: #000;" class="showpageOf"> Pages ('+(postNum-1)+')</span>'+html;if(thisNum<(postNum-1)){html+=downPageHtml}if(postNum==1)postNum++;html+='</div>';var pageArea=document.getElementsByName("pageArea");var blogPager=document.getElementById("blog-pager");if(postNum<=2){html=''}for(var p=0;p<pageArea.length;p++){pageArea[p].innerHTML=html}if(pageArea&&pageArea.length>0){html=''}if(blogPager){blogPager.innerHTML=html}}function showpageCount2(json){var thisUrl=home_page_url;var htmlMap=new Array();var isLablePage=thisUrl.indexOf("/search/label/")!=-1;var thisLable=isLablePage?thisUrl.substr(thisUrl.indexOf("/search/label/")+14,thisUrl.length):"";thisLable=thisLable.indexOf("?")!=-1?thisLable.substr(0,thisLable.indexOf("?")):thisLable;var thisNum=1;var postNum=1;var itemCount=0;var fFlag=0;var eFlag=0;var html='';var upPageHtml='';var downPageHtml='';var labelHtml='<span class="showpageNum"><a href="/search/label/'+thisLable+'?&max-results='+pageCount+'">';var thisUrl=home_page_url;for(var i=0,post;post=json.feed.entry[i];i++){var timestamp1=post.published.$t.substring(0,19)+post.published.$t.substring(23,29);timestamp=encodeURIComponent(timestamp1);var title=post.title.$t;if(title!=''){if(itemCount==0||(itemCount%pageCount==(pageCount-1))){if(thisUrl.indexOf(timestamp)!=-1){thisNum=postNum}if(title!='')postNum++;htmlMap[htmlMap.length]='/search/label/'+thisLable+'?updated-max='+timestamp+'&max-results='+pageCount}}itemCount++}for(var p=0;p<htmlMap.length;p++){if(p>=(thisNum-displayPageNum-1)&&p<(thisNum+displayPageNum)){if(fFlag==0&&p==thisNum-2){if(thisNum==2){upPageHtml=labelHtml+upPageWord+'</a></span>'}else{upPageHtml='<span class="showpage"><a href="'+htmlMap[p]+'">'+upPageWord+'</a></span>'}fFlag++}if(p==(thisNum-1)){html+='<span class="showpagePoint">'+thisNum+'</span>'}else{if(p==0){html=labelHtml+'1</a></span>'}else{html+='<span class="showpageNum"><a href="'+htmlMap[p]+'">'+(p+1)+'</a></span>'}}if(eFlag==0&&p==thisNum){downPageHtml='<span class="showpage"> <a href="'+htmlMap[p]+'">'+downPageWord+'</a></span>';eFlag++}}}if(thisNum>1){if(!isLablePage){html=''+upPageHtml+' '+html+' '}else{html=''+upPageHtml+' '+html+' '}}html='<div class="showpageArea"><span style="COLOR: #000;" class="showpageOf"> Pages ('+(postNum-1)+')</span>'+html;if(thisNum<(postNum-1)){html+=downPageHtml}if(postNum==1)postNum++;html+='</div>';var pageArea=document.getElementsByName("pageArea");var blogPager=document.getElementById("blog-pager");if(postNum<=2){html=''}for(var p=0;p<pageArea.length;p++){pageArea[p].innerHTML=html}if(pageArea&&pageArea.length>0){html=''}if(blogPager){blogPager.innerHTML=html}}var home_page_url=location.href;var thisUrl=home_page_url;if(thisUrl.indexOf("/search/label/")!=-1){if(thisUrl.indexOf("?updated-max")!=-1){var lblname1=thisUrl.substring(thisUrl.indexOf("/search/label/")+14,thisUrl.indexOf("?updated-max"))}else{var lblname1=thisUrl.substring(thisUrl.indexOf("/search/label/")+14,thisUrl.indexOf("?&max"))}}var home_page="/";if(thisUrl.indexOf("?q=")==-1){if(thisUrl.indexOf("/search/label/")==-1){document.write('<script src="'+home_page+'feeds/posts/summary?alt=json-in-script&callback=showpageCount&max-results=99999" ><\/script>')}else{document.write('<script src="'+home_page+'feeds/posts/full/-/'+lblname1+'?alt=json-in-script&callback=showpageCount2&max-results=99999" ><\/script>')}}
//]]>
  </script>
  </b:if>
  </b:if>
3. Kemudian simpan Template
Suka artikel ini ?

About Unknown

Admin Blog

15 komentar

Click here for komentar
Terima Kasih Sudah Berkomentar
December 31, 2013 at 11:59 PM This comment has been removed by a blog administrator.
Terima Kasih Sudah Berkomentar
January 1, 2014 at 12:16 AM

Semoga punya saya fast load!

Balas
Terima Kasih Sudah Berkomentar
January 1, 2014 at 12:21 AM

amin :)

Balas
Terima Kasih Sudah Berkomentar
January 1, 2014 at 12:21 AM

wow keren

Balas
Terima Kasih Sudah Berkomentar
January 1, 2014 at 12:22 AM This comment has been removed by a blog administrator.
Terima Kasih Sudah Berkomentar
January 1, 2014 at 12:24 AM

thx

Balas
Terima Kasih Sudah Berkomentar
January 1, 2014 at 12:35 AM

Hem, macem ni gak ada di blog aku.. Kapan2 deh di cobain, pake html soalx :)

Balas
Terima Kasih Sudah Berkomentar
Anonymous
January 1, 2014 at 12:58 AM

Mantap Nih.. tapi Ane Udah Pake.. :D

Balas
Terima Kasih Sudah Berkomentar
January 1, 2014 at 1:14 AM

:)

Balas
Terima Kasih Sudah Berkomentar
January 1, 2014 at 1:14 AM

sip :D

Balas
Terima Kasih Sudah Berkomentar
January 1, 2014 at 2:44 AM

page navigation fast load pasti banyak yang nyari mas. mungkin kapan-kapan bisa juga saya terapkan nih :)

Balas
Terima Kasih Sudah Berkomentar
January 1, 2014 at 5:40 AM

ane juga udah pake mirip2 kayak gini pokoknya cepet :-d

Balas
Terima Kasih Sudah Berkomentar
you
January 1, 2014 at 6:29 AM

ane pake ini

Balas
Terima Kasih Sudah Berkomentar
Anonymous
January 8, 2014 at 6:16 AM

Memangnya yang membuat fast load itu apanya kang? :/

Balas
Terima Kasih Sudah Berkomentar
March 20, 2014 at 8:25 AM

gan, pagenum nya itu gabisa auto kah?

Balas

Tolong berkomentar sesuai topik pembicaraan, dilarang spam dan jangan menaruh link aktif, terimakasih. Join This Site Show Konversi KodeHide Konversi Kode Show EmoticonHide Emoticon

Silakan berkomentar dengan sopan