Pada artikel berikut akan dijelaskan tentang cara pembuatan halaman Arsip di blog seperti terlihat pada gambar di bawah ini:
Pada halaman arsip ini, judul postingan ditampilkan berdasarkan bulan dan tanggal publikasi. Halaman ini berfungsi untuk navigasi dan internal link untuk memudahkan pengunjung dalam mencari topik-topik yang berada didalam blog kita. Berikut adalah cara membuat arsip blog seperti terlihat pada gambar di atas:
Langkah-langkah dalam membuat arsip blog:
- Login ke dashboard blogger
- Klik "Page" > "New Page"
- Isi Judul dengan "Archives"
- Klik mode HTML dan copy pastekan script berikut di halaman HTML tersebut.<script type="text/javascript">function LoadTheArchive(TotalFeed){var PostTitles = new Array();var PostURLs = new Array();var PostYears = new Array();var PostMonths = new Array();var PostDays = new Array();if("entry" in TotalFeed.feed){var PostEntries=TotalFeed.feed.entry.length;for(var PostNum=0; PostNum<PostEntries ; PostNum++){var ThisPost = TotalFeed.feed.entry[PostNum];PostTitles.push(ThisPost.title.$t);PostYears.push(ThisPost.published.$t.substring(0,4));PostMonths.push(ThisPost.published.$t.substring(5,7));PostDays.push(ThisPost.published.$t.substring(8,10));var ThisPostURL;for(var LinkNum=0; LinkNum < ThisPost.link.length; LinkNum++){if(ThisPost.link[LinkNum].rel == "alternate"){ThisPostURL = ThisPost.link[LinkNum].href;break}}PostURLs.push(ThisPostURL);}}DisplaytheTO C(PostTitles,PostURLs,PostYears,PostMonths,PostDays);}function DisplaytheTOC(PostTitles,PostURLs,PostYears,PostMonths,PostDays){var MonthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];var NumberOfEntries=PostTitles.length;var currentMonth = "";var currentYear = "";for(var EntryNum = 0; EntryNum < NumberOfEntries; EntryNum++){NameOfMonth = MonthNames[parseInt(PostMonths[EntryNum],10)-1]if (currentMonth != NameOfMonth || currentYear != PostYears[EntryNum]){currentMonth = NameOfMonth;currentYear = PostYears[EntryNum];document.write("<div class='dateStyle'><br />" + currentMonth+" "+currentYear+" </div>");}document.write('<a href ="'+PostURLs[EntryNum]+'"><div class=dayStyle>'+parseInt(PostDays[EntryNum],10)+": </div> "+PostTitles[EntryNum]+"</a><br />");}}</script><script src="http://YOURBLOGHERE.blogspot.com/feeds/posts/default?max-results=500&alt=json-in-script&callback=LoadTheArchive"/></script><!--CUSTOMIZATION--><style type="text/css">.dateStyle {color:#000;font-weight:bold;font-size: 15px;font-family: Arial, sans-serif;margin: 0;}.dayStyle {color:#000;font-weight:bold;font-family: Arial, sans-serif;display: inline-block;}</style>
- Ganti tulisan yang bewarna merah dengan alamat blog anda.
- Klik save dan publih.
(http://blogromeltea.blogspot.co.id/2016/02/cara-membuat-halaman-indeks-arsip-atau.html)