Show Recent Posts With Featured Thumbnails in Blogger

We have talked about in detail how you can utilize JavaScript to concentrate information from Blogger JSON Feed API and utilize it to manufacture devices, for example, "Late Posts Widget" and "Latest Comments Widget". The JSON instructional exercise arrangement would help a designer to make quality gadgets for blogspot blogging stage.

 Today's instructional exercise will demonstrate to you the finished result of what should be possible utilizing JSON nourish for posts. I will impart to you a propelled gadget that will show late posts in dropping request (most recent at top)⇪ alongside post thumbnails, post rundown, timestamp, remark number, mark label, creator name and alter interface.

You can add it to your blogger sites to show most recent posts in an interesting style. This is the main gadget of its kind with so much elements.

Upgrade: A more conservative, adaptable and completely utilitarian variant of this gadget has been discharged. Checkout

Late posts Label Gadget with Avatars, Animated Thumbnails and Labels! 
What is a Blogger Recent Posts Widget? ⇙⇙

A latest posts gadget shows your most recent posts in sliding request with freshest at top. It demonstrates a rundown of your most recent blog entries alongside thumbnails, post passage and post meta data. It works with all blogspot online journals. Duplicate the code and glue it inside a HTML/JavaScript contraption, that straightforward!

You can likewise utilize it to show posts by name by posting late posts from a particular mark. You can modify it to show posts in magazine style form with vertical, level, exhibition style posting. I will examine all such conceivable outcomes in my coming instructional exercises. Designers at themeforest utilize a similar strategy to make magazine style blogger layouts. You will figure out how to code it sans preparation through our JSON arrangement.

Full elements are the accompanying: 
Post Title
Highlighted Image - With outsider picture bolster and YouTube Thumbnails bolster
Post outline
Perused more connection
Creator Name
Name/Category/Tag name
Remarks Count
Distribute date
Alter connect tooltip that will demonstrate post Update Date and Time.
Lightweight
Liquid and responsive 

Shows the accompanying GIF preloader which turns and throbs when the gadget loads or when information is asked for by program from JSON bolster. 

preloader for blogger websites ⇣
Once completely stacked the blog entries are shown in dropping request (Latest at top)




Lets get to coding! 
Add Recent Posts Widget To Your Blog

Take after these simple strides to add this contraption to your blogspot web journals:

⤰ Go To Blogger ➥ Template 

⤯ Backup your format

⤯ Click Edit HTML

⤮ Paste the accompanying code simply above </head> tag

Take note of: This progression is discretionary. Skip it on the off chance that you have as of now added jQuery library source connections to your blogger template 
<script async='' src='https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text/javascript'></script> 
Next glue the accompanying template joins for FontAwesome and Oswald text style simply above </head>. Skip adding the links if you already have added them inside your templates

Presently glue the accompanying CSS code simply above ]]></b:skin>
<link href='http://fortawesome.github.io/Font-Awesome/assets/font-awesome/css/font-awesome.css' rel='stylesheet'/><link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'/>
Now paste the following CSS code just above    ]]></b:skin> 
/*############Recent Posts Widget##################*/.mbtlist {list-style-type:none;overflow:hidden; padding:10px!important;} .mbtlist li {margin:0px auto 20px auto; clear:both; color:#666; font-family:helvetica; font-size:12px; } .mbtlist i{color:#999; padding-right:4px; } .mbtlist .iline{line-height:2em; clear:both; border:1px solid #eee; margin-top:10px; padding: 0px 4px;   font-size: 12px;} .mbtlist div span{margin:0 10px 0 0; display:inline-block;} .mbtlist span {display:block; margin:5px 0px 0px; padding-right:5px;} .mbtlist .icon {color: #999;font-family: verdana;font-size: 12px;text-align: justify;} .mbtlist img {float:left; margin:0px 10px 10px 0px; border:6px solid #fff; padding:0px; width:150px; height:100px; box-shadow:-1px -1px 4px #777; } .mbtlist .mbttitle {font-family:oswald; font-size:18px; color:#0080ff; font-weight:normal; text-decoration:none;    line-height: 1.4em;} .mbtlist .mbttitle:hover, .mbtlist .itotal a:hover  {color:#00A5FF;} .mbtlist .iedit a{text-decoration:none; color:#999; cursor:pointer} .mbtlist .iedit:before, .mbtlist .iauthor:before, .mbtlist .itag:before, .mbtlist .icomments:before, .mbtlist .idate:before, .mbtlist .itotal span:before{font-family:fontAwesome; position:relative; padding-right:5px;} .mbtlist .iauthor:before {content:'\f007';} .mbtlist .itag:before {content:'\f02c';} .mbtlist .icomments:before {content:'\f086';} .mbtlist .idate:before {content:'\f017';} .mbtlist .iedit:before {content:'\f040';}.mbtlist .imore {font-size:12px; font-weight:bold; text-decoration:none; color:#999;}.mbtlist .itotal {color:#333;  padding:5px 10px; border:1px solid #eee;}.mbtlist .itotal a {font-family:oswald; font-size:12px; font-weight:normal; color:#0080ff; text-decoration:none}.mbtlist .itotal span:before {content:'\f07c';}.mbtlist .itotal span font {padding:0px 3px; color:#333; font-family:georgia; font-size:15px; font-weight:bold}#mbtloading1{ margin: 20% auto; background: url('http://downloads.mybloggertricks.com/Spin%20and%20pulsate.gif') no-repeat left center;width: 80px;height: 80px;}/*------ CSS3 Tooltip Shortcode -------------*/ .tooltip1{outline:none;text-decoration:none!important;position:relative;color: orange!important; font-weight: bold;}.tooltip1:hover {border-bottom: none;}.tooltip1 strong{line-height:30px}.tooltip1 > span{max-width:300px;width:115px;padding:5px 8px;opacity:0;bottom:170%;left:0px; visibility:hidden;z-index:10;position:absolute;font-family:helvetica;font-size:12px;font-weight:bold;border-radius:2px;box-shadow:2px 2px 5px #999;-webkit-transition-property:opacity,margin-top,visibility,margin-left;-webkit-transition-duration:0.4s,0.3s,0.4s,.3s;-webkit-transition-timing-function:ease-in-out,ease-in-out,ease-in-out,ease-in-out;transition-property:opacity,margin-top,visibility,margin-left;transition-duration:0.4s,0.3s,0.4s,.3s;transition-timing-function:ease-in-out,ease-in-out,ease-in-out,ease-in-out}.tooltip1 > span img{float:right;width:110px;margin:0 0 30px 10px;padding: 0;border: none;}.tooltip1:hover > span{opacity:1;text-decoration:none;visibility:visible;overflow:visible;display:inline;margin-left:-90px}.tooltip1 span b{width:15px;height:15px;right:25px;bottom:-9px;display:block;position:absolute;-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg);display:none\0/;*display:none}.tooltip1 > span{color:#fff;background:orange;border:1px solid #ffffff}.tooltip1 span b{background:orange;border-bottom:1px solid #ffffff;border-left:1px solid #ffffff}
Alter the hues: 
To change the blue shade of the post title supplant #0080ff with your preferred connection shade and supplant #00A5FF to change the connection shading for mouse float.


  • To change the alter connect shading change orange 
  • To change the tooltip shading change orange with a hexadecimal shading code of your inclination. 
  • To change the width and stature measurements of the highlighted thumbnail alter: width:150px; height:100px


⟹ Save your format and you are practically done!

⟹Finally go to Layout area and snap "Include a Gadget". 

⟹Choose HTML/JavaScript gadget and glue the accompanying code inside it:
<div id="mbtloading1" ></div> <script type="text/javascript">//#################### Defaults var ListBlogLink = window.location.hostname; var ListCount = 5; var ChrCount = 150; var TitleCount = 66; var ImageSize = 200; //################ Function Start function mbtlist(json) { document.write('<ul class="mbtlist">'); for (var i = 0; i < ListCount; i++) //################### Variables Declared var listing= ListImage = ListUrl = ListTitle = ListImage = ListContent = ListConten = ListAuthor = ListTag = ListDate = ListUpdate = ListComments = thumbUrl = TotalPosts = sk = ListMonth = Y = D = M = m = YY = DD = MM = mm = TT =  "";//################### Category if (json.feed.entry[i].category != null) for (var k = 0; k < json.feed.entry[i].category.length; k++) {     ListTag += json.feed.entry[i].category[k].term; if(k < json.feed.entry[i].category.length-1) { ListTag += ", ";} }//################### URL for (var j = 0; j < json.feed.entry[i].link.length; j++) {       if (json.feed.entry[i].link[j].rel == 'alternate') {         break;       }     } ListUrl= "'" + json.feed.entry[i].link[j].href + "'";//################### Info TotalPosts = json.feed.openSearch$totalResults.$t; if (json.feed.entry[i].title!= null) ListTitle= json.feed.entry[i].title.$t.substr(0, TitleCount); if (json.feed.entry[i].thr$total) ListComments= json.feed.entry[i].thr$total.$t; ListAuthor= json.feed.entry[i].author[0].name.$t.split(" "); ListAuthor=ListAuthor.slice(0, 1).join(" ");
//################### Content CheckListConten = json.feed.entry[i].content.$t; ListContent= ListConten.replace(/(<([^>]+)>)/ig,"").substring(0, ChrCount);//################### Date FormatListMonth= ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];ListDate= json.feed.entry[i].published.$t.substring(0,10);                         Y = ListDate.substring(0, 4);                         m = ListDate.substring(5, 7);                          D = ListDate.substring(8, 10);                          M = ListMonth[parseInt(m - 1)];                       ListUpdate= json.feed.entry[i].updated.$t.substring(0, 16);                         YY = ListUpdate.substring(0, 4);                         mm = ListUpdate.substring(5, 7);                          DD = ListUpdate.substring(8, 10);                          TT = ListUpdate.substring(11, 16);                          MM = ListMonth[parseInt(mm - 1)];   //################### Thumbnail Check // YouTube scanif (json.feed.entry[i].content.$t.match(/youtube\.com.*(\?v=|\/embed\/)(.{11})/) != null) {    var youtube_id = json.feed.entry[i].content.$t.match(/youtube\.com.*(\?v=|\/embed\/)(.{11})/).pop();         if (youtube_id.length == 11) {         var ListImage = "'//img.youtube.com/vi/"+youtube_id+"/0.jpg'";         } }else if (json.feed.entry[i].media$thumbnail) thumbUrl = json.feed.entry[i].media$thumbnail.url; sk= thumbUrl.replace("/s72-c/","/s"+ImageSize+"/"); ListImage= "'" + sk.replace("?imgmax=800","") + "'"; }else if (json.feed.entry[i].content.$t.match(/src=(.+?[\.jpg|\.gif|\.png]")/) != null) // Support For 3rd Party Images ListImage =  json.feed.entry[i].content.$t.match(/src=(.+?[\.jpg|\.gif|\.png]")/)[1]; else ListImage= "'https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyCY3b3c8cQ4hMX_2Vc01VML2lOWOJsQPTSgFOhXRY1Ss9EPP6ip_HpxpIt45VNDP1VKyP3E7qT13xdzmcJe1V0DN17_wlILY7_8fFvTKO-QCCvNeBv08tWFxypQf_WBw51CFUbv9t2zM/s200/Icon.png'"; //################### Printing Listvar listing = "<li class='node"+[i]+"' ><a href=" + ListUrl+   "><img src=" +ListImage+ "/></a><a class='mbttitle' href=" + ListUrl+ "target='_blank'>" + ListTitle+ "</a> <span class='icon'>" +ListContent+ " ...  <a href=" +ListUrl+ " class='imore'>more »</a></span><div class='iline'><span class='iauthor'>" +ListAuthor+ "</span><span class='itag'>" +ListTag+ "</span><span class='icomments'>" + ListComments+ "</span><span class='idate'>" + M + " " + D + ", " + Y +"</span><span class='iedit'> <a class='tooltip1'>Edited<span><b></b>On ► " + MM + " " + DD + ", " + YY + " at ► " +TT+ " </span></a> </span></div></li>"; document.write(listing); document.write("<div class='itotal'><span> <a href='"+ListBlogLink+"/search'>View all <font>"+TotalPosts+"</font> posts</a></span></div></ul>"); </script><script> var ListBlogLink = "http://www.codedforum.com.ng"; var ListCount = 5; </script><script> document.write("<script src='"+ListBlogLink+"/feeds/posts/default?alt=json-in-script&callback=mbtlist'></"+"script>"); </script><script> document.getElementById("mbtloading1").style.display = "none";</script>
You can roll out these improvements: 
Supplant http://www.codedforum.com.ng this with your blog URL

To increment or diminishing the quantity of posts sections, alter: ListCount = 5 

To lessen the length of title characters alter TitleCount = 66 

To build the picture determination quality (angle proportion) if incase you wish to show vast included thumbnails then alter ImageSize = 200

To choose what number of characters to show as post outline (passage) edit:ChrCount = 150

⟹ Save your gadget and see it play in real life! =)

Could You Guess How To Display Posts By Label? 
At Codedforum we go for instructing the perusers to take in the center essentials of programming rather than simply sharing an ordinary howto instructional exercise. In the above code you simply need to roll out a basic improvement keeping in mind the end goal to show most recent posts by a particular name. I have as of now talked about how to do that in the JSON arrangement. Do read that and get back here proposing your answer saying all the fundamental strides.

I will sit tight for your answers, I will share it in my next instructional exercise and connection to your blog in the event that you addressed effectively. =) 

 

Thanks For You Reading The Post We are very happy for you to come to our site. Our Website Domain name http://codedforum.blogspot.com/.
Newer Posts Newer Posts Older Posts Older Posts

More posts

Comments

Post a Comment