Cara Membuat Widget Recent Post di Blogger – Recent Post dalam arti Postingan Terbaru ini sangat diperlukan sekali untuk kamu yang ingin artikel yang baru saja dipublish bisa terlihat oleh pengunjung.
Maka dari itu, saya ardnat.com sarankan untuk membuat widget recent post di blog kamu.
Recent Post adalah salah satu widget yang sering dipasang dalam suatu blog atau website selain Populer Post dan Random Post.
Dalam fitur Blogger belum ada fitur untuk Membuat Recent Post, jadi anda harus berusaha sedikit untuk mencari cara membuat recent post di blogger. Ini dia Cara Membuat Recent Post Responsive Fast Loading di Blogger.
Sebelum memasang widget recent post, kamu bisa melihat demonya diatas postingan ini atau lihat beberapa demo dibawah script kode recent post ini.
Cara Membuat Widget Recent Post Keren di Blog
<div class=”recentpoststyle”> <!–<script src=”https://cdn.rawgit.com/Brando07/share/newbe/recent-post-seocips-1.js”></script>–> <script type=’text/javascript’> function showlatestposts(a){for(var b=0;b<posts_no;b++){var e,c=a.feed.entry[b],d=c.title.$t;if(b==a.feed.entry.length)break;for(var f=0;f<c.link.length;f++)if(“alternate”==c.link[f].rel){e=c.link[f].href;break}d=d.link(e);var g=”… read more”;g=g.link(e);var h=c.published.$t,i=h.substring(0,4),j=h.substring(5,7),k=h.substring(8,10),l=new Array;if(l[1]=”Jan”,l[2]=”Feb”,l[3]=”Mar”,l[4]=”Apr”,l[5]=”May”,l[6]=”Jun”,l[7]=”Jul”,l[8]=”Aug”,l[9]=”Sep”,l[10]=”Oct”,l[11]=”Nov”,l[12]=”Dec”,”content”in c)var m=c.content.$t;else if(“summary”in c)var m=c.summary.$t;else var m=””;var n=/<S[^>]*>/g;if(m=m.replace(n,””),document.write(‘<li class=”recent-post-title”>’),document.write(d),document.write(‘</li><div class=”recent-post-summ”>’),1==post_summary)if(m.length<summary_chars)document.write(m);else{m=m.substring(0,summary_chars);var o=m.lastIndexOf(” “);m=m.substring(0,o),document.write(m+” “+g)}document.write(“</div>”),1==posts_date&&document.write(‘<div class=”post-date”>’+l[parseInt(j,10)]+” “+k+” “+i+”</div>”)}} </script> <script> var posts_no = 5;var posts_date = true;var post_summary = true;var summary_chars = 80;</script> <script src=”/feeds/posts/default?orderby=published&alt=json-in-script&callback=showlatestposts”> </script> <noscript>Your browser does not support JavaScript!</noscript> <style type=”text/css”> .recentpoststyle {counter-reset: countposts;list-style-type: none;} .recentpoststyle a {text-decoration: none; color: #49A8D1;} .recentpoststyle a:hover {color: #000;} .recentpoststyle li:before {content: counter(countposts,decimal);counter-increment: countposts;float: left;z-index: 2;position:relative;font-size: 20px;font-weight: bold;color: #fff;background: #69B7E2; margin: 15px 5px 0px -6px; padding: 0px 10px; border-radius: 100%;} li.recent-post-title { padding: 5px 0px;} .recent-post-title { font-family: “Avant Garde”,Avantgarde,”Century Gothic”,CenturyGothic,AppleGothic,sans-serif;} .recent-post-title a {color: #444;font-size: 13px; text-decoration: none; padding: 2px; font-weight: bold;} .post-date {padding: 5px 2px 5px 30px; font-size: 11px; color: #999; margin-bottom: 5px;} .recent-post-summ { border-left: 1px solid #69B7E2; color: #777; padding: 0px 5px 0px 20px; margin-left: 11px; font-family: Garamond,Baskerville,”Baskerville Old Face”,”Hoefler Text”,”Times New Roman”,serif; font-size: 15px;} </style></div>
Catatan Penting!
Ganti angka yang saya bold dengan angka yang kamu inginkan berapa jumlah recent post atau artikel terbaru yang akan tampil.
Cara Membuat Widget Recent Post dengan Tombol Next
<style scoped=” type=’text/css’>
/* Recent Post Navigasi */
#recentpostnav{border:1px solid #585858;width:100%;margin:0 auto}
#recentpostsae{margin:0}
.recentpostel{background:#fff;display:block;border:1px solid #ddd;margin:5px 0;padding:10px;height:79px}
.recentpostel img{background:#fff;padding:4px;float:left;height:70px;margin-right:8px;width:70px;border:1px solid #ddd}
.recentpostel h6,.recentpostel h6 a{text-decoration:none;font-size:13px!important;font-weight:700!important;margin:0;color:#111}
.recentpostel:hover{background-color:#fefefe}
.recentpostel p{font-size:12px;text-align:left;color:#555;line-height:normal;margin:5px 0}
#recentpostload{color:#888;font-family:Tahoma;font-size:100px;letter-spacing:-10px;text-align:center;text-shadow:-5px 0 1px #444;background:url(https://2.bp.blogspot.com/-60aISBQLRY0/VFBMqzLfzGI/AAAAAAAABgM/GInmVTvEzkc/s1600/loader.gif) 50% 50% no-repeat #fff;height:470px;border:1px solid #ddd}
#recentpostnavfeed{border:1px solid #ddd;color:#bbb;font-family:Verdana;font-size:12px;text-align:center;margin:0}
#recentpostnavfeed:hover{background-color:#fefefe}
#recentpostnavfeed a{color:#141414!important;font-family:Tahoma!important;font-size:12px!important;font-weight:400!important;display:block;padding:5px 10px}
#recentpostnavfeed span{padding:5px 10px}
#recentpostnavfeed .next{float:right}
#recentpostnavfeed .previous{float:left}
#recentpostnavfeed .home{text-align:center}
#recentpostnavfeed a:hover,#recentpostnavfeed span.noactived{color:transparant!important}
</style>
<script type=’text/javascript’>
//<![CDATA[
var numfeed = 5;
var startfeed = 0;
var urlblog = “https://www.ardnat.com”;
var charac = 40;
var urlprevious, urlnext;
function arlinafeed(e,t){for(var n=e.split(“<“),r=0;r<n.length;r++)-1!=n[r].indexOf(“>”)&&(n[r]=n[r].substring(n[r].indexOf(“>”)+1,n[r].length));return n=n.join(“”),n=n.substring(0,t-1)}function showrecentpostsae(e){var t,n,r,a,i,s=””;urlprevious=””,urlnext=””;for(var l=0;l<e.feed.link.length;l++)”previous”==e.feed.link[l].rel&&(urlprevious=e.feed.link[l].href),”next”==e.feed.link[l].rel&&(urlnext=e.feed.link[l].href);for(var d=0;d<numfeed&&d!=e.feed.entry.length;d++){t=e.feed.entry[d],n=t.title.$t;for(var l=0;l<t.link.length;l++)if(“alternate”==t.link[l].rel){r=t.link[l].href;break}i=”content”in t?t.content.$t:”summary”in t?t.summary.$t:””,a=”media$thumbnail”in t?t.media$thumbnail.url:”http://3.bp.blogspot.com/-BHuXHny1kOk/VXrkSyxKCjI/AAAAAAAACas/pZLJAEUDtds/s1600/no-image.png”,s+=”<div class=’recentpostel’>”,s+=”<a href='”+r+”‘ target=’_blank’><img src='”+a+”‘ /></a>”,s+=”<h6><a href='”+r+”‘>”+n+”</a></h6>”,s+=”<p>”+arlinafeed(i,charac)+”…</p>”,s+=”</div>”}document.getElementById(“recentpostsae”).innerHTML=s,s=””,s+=urlprevious?”<a href=’javascript:navigasifeed(-1);’ class=’previous’>Previous</a>”:”<span class=’noactived previous’>Previous</span>”,s+=urlnext?”<a href=’javascript:navigasifeed(1);’ class=’next’>Next</a>”:”<span class=’noactived next’>Next</span>”,s+=”<a href=’javascript:navigasifeed(0);’ class=’home’>Home</a>”,document.getElementById(“recentpostnavfeed”).innerHTML=s}function navigasifeed(e){var t,n;-1==e?(t=urlprevious.indexOf(“?”),n=urlprevious.substring(t)):1==e?(t=urlnext.indexOf(“?”),n=urlnext.substring(t)):n=”?start-index=1&max-results=”+numfeed+”&orderby=published&alt=json-in-script”,n+=”&callback=showrecentpostsae”,incluirscript(n)}function incluirscript(e){1==startfeed&&removerscript(),document.getElementById(“recentpostsae”).innerHTML=”<div id=’recentpostload’></div>”,document.getElementById(“recentpostnavfeed”).innerHTML=””;var t=urlblog+”/feeds/posts/default”+e,n=document.createElement(“script”);n.setAttribute(“type”,”text/javascript”),n.setAttribute(“src”,t),n.setAttribute(“id”,”arlinalabel”),document.getElementsByTagName(“head”)[0].appendChild(n),startfeed=1}function removerscript(){var e=document.getElementById(“arlinalabel”),t=e.parentNode;t.removeChild(e)}onload=function(){navigasifeed(0)};
//]]>
</script>
<div id=”recentpostsae”></div>
<div id=”recentpostnavfeed”></div>
Catatan Penting!
- var numfeed : Silahkan ganti dengan jumlah artikel yang ingin kalian tampilkan.
- var urlblog : Silahkan ganti dengan url domain kalian.
- var charac : Silahkan ganti dengan jumlah karakter dalam artikel. Jika ingin menonaktifkan, ganti dengan angka 0.
Cara Membuat Widget Artikel Terbaru di Blogger
<style>/* Recent Posts by Bungfrangki.com */
#recent-articles .widget-content, #recent-articles ul {padding: 0;counter-reset:count;margin: 0 auto;display: block}
#recent-articles a:link, #recent-articles a:visited {font-weight: normal}
#recent-articles ul li {background-color:#f7f7f7;margin:0 auto;padding:8px 8px 8px 60px;list-style:none;position:relative;border-bottom:1px solid #fff;font-size:90%;text-align:left}
#recent-articles ul li:before{color: #fff!important;counter-increment: count;content: counter(count);position: absolute;left:0;top:0;bottom:0;text-align: center;z-index: 51;transition: all .4s;width:50px;font-size: 150%!important;background:#2b71a2;font-weight:500;text-align: center;padding:0;border-right:1px solid #fff;display:flex;flex-direction:column;justify-content:center;height:100%}
#recent-articles ul li:last-child{border:none}
#recent-articles ul li a {font-weight:400 ;display:block;color:#222 ;text-decoration:none ;line-height:1.4em ;}
#recent-articles ul li:hover{background-color:#f5f5f5;}
#recent-articles ul li:hover:before{background-color:#24699A;}
#recent-articles ul li a:hover,#recent-articles ul li:hover a {color: #2b71a2 !important;}
#recent-articles ul li:before, #recent-articles ul li .item-title a {font-weight: 400;font-size: 12px;color: inherit;text-decoration: none}</style>
<script type=’text/javascript’>
//<![CDATA[
numPosts = 10;
function recentPosts(a){if(document.getElementById(“recent-posts”)){var e=a.feed.entry,title,link,content=””,ct=document.getElementById(“recent-posts”);ct.async=true;for(var i=0;i<numPosts;i++){for(var j=0;j<numPosts;j++){if(e[i].link[j].rel==”alternate”){link=e[i].link[j].href;break}}var title=e[i].title.$t;content+='<li class=”recent-posts”><a href=”‘+link+'” title=”‘+title+'”>’+title+'</a></li>’}ct.innerHTML=content}}var rcp=document.createElement(‘script’);rcp.async=true;rcp.src=’/feeds/posts/summary?alt=json-in-script&orderby=published&max-results=’+numPosts+’&callback=recentPosts’;document.getElementsByTagName(‘head’)[0].appendChild(rcp);
//]]>
</script>
<div id=’recent-articles’ class=’recent-articles’><ul id=”recent-posts”></ul></div>
Catatan Penting!
Untuk mengganti jumlah artikel yang di tampilkan pada widget artikel terbaru, silahkan ganti angka 10 dengan jumlah artikel yang ingin kamu tampilkan.
Banyak dilihat:
- Cara Membuat Widget Random Post Responsive di Blog
- Cara Membuat Kotak Pencarian Responsive di Blog
- Cara Memasang Tombol Share Melayang di Blog
Cara Memasang Widget Recent Post di Blog
1. Pergi ke “Tata Letak” > “Add Widget atau Tambahkan Widget” > Pilih “HTML/Javascript”
2. Copy dan Paste Script Recent Post diatas ke Widget yang sudah ditambahkan tadi.
3. Selesai dan lihat tampilannya.
Akhir Kata
Itu dia beberapa cara membuat widget recent post di blogger yang bisa coba kamu gunakan untuk mempercantik desain website atau blog kamu.
Semoga bisa bermanfaat dan jangan lupa juga bagikan artikel ini ke teman-teman ataupun grup blogger kamu. Terima kasih dan sehat selalu ya.