Posting this time will explain how to make a thumbnail in blogger post . like this example:
Steps you should do is:
1. Open your Blogger.
2. click on "Layout"
3. On the Elements page, find where you will put your post tumbnail.
4. Then click on "add a gadget"
5. Select "HTML / JavaScript"
6. copypaste scrip code below:
<script language="JavaScript">
imgr = new Array();
imgr[0] = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiilQ3BIgIIIuhOKRKJHY2lNY04kjUDL5-pe3_loumgXAhYHOQR8HXmp9_6XHc8BU-s_cdxpWqiImMKqWLYOhFbmOe8xc59BzRTs6gkAfpDfIGSmmGYxreExbWFByitRogzMYJXEtG1lus/s1600-r/No+image.jpg";
showRandomImg = true;
aBold = true;
summaryPost = 0; //
summaryTitle = 80; //
numposts = 4; //
home_page = "http://your-url.com/";
label1 = "your label"; //change this to your desired label name
tLabel1 = "your label"; //change this to your desired label name
function removeHtmlTag(strx,chop){
var s = strx.split("<");
for(var i=0;i<s.length;i++){
if(s[i].indexOf(">")!=-1){
s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length);
}
}
s = s.join("");
s = s.substring(0,chop-1);
return s;
}
function showrecentposts(json) {
j = (showRandomImg) ? Math.floor((imgr.length+1)*Math.random()) : 0;
img = new Array();
for (var i = 0; i < numposts; i++) {
var entry = json.feed.entry[i];
var posttitle = entry.title.$t;
var pcm;
var posturl;
if (i == json.feed.entry.length) break;
for (var k = 0; k < entry.link.length; k++) {
if (entry.link[k].rel == 'alternate') {
posturl = entry.link[k].href;
break;
}
}
for (var k = 0; k < entry.link.length; k++) {
if (entry.link[k].rel == 'replies' && entry.link[k].type == 'text/html') {
pcm = entry.link[k].title.split(" ")[0];
break;
}
}
if ("content" in entry) {
var postcontent = entry.content.$t;}
else
if ("summary" in entry) {
var postcontent = entry.summary.$t;}
else var postcontent = "";
postdate = entry.published.$t;
if(j>imgr.length-1) j=0;
img[i] = imgr[j];
s = postcontent ; a = s.indexOf("<img"); b = s.indexOf("src=\"",a); c = s.indexOf("\"",b+5); d = s.substr(b+5,c-b-5);
if((a!=-1)&&(b!=-1)&&(c!=-1)&&(d!="")) img[i] = d;
//cmtext = (text != 'no') ? '<i><font color="'+acolor+'">('+pcm+' '+text+')</font></i>' : '';
var month = [1,2,3,4,5,6,7,8,9,10,11,12];
var month2 = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
var day = postdate.split("-")[2].substring(0,2);
var m = postdate.split("-")[1];
var y = postdate.split("-")[0];
for(var u2=0;u2<month.length;u2++){
if(parseInt(m)==month[u2]) {
m = month2[u2] ; break;
}
}
//var daystr = (showPostDate) ? '<i><font color="'+acolor+'"> - ('+day+ ' ' + m + ' ' + y + ')</font></i>' : "";
posttitle = (aBold) ? ""+posttitle+"" : posttitle;
var trtd = '<li class="art-BlockContent-body"style="list-style:none;margin-bottom:0.4em;margin-top:-0.4em; margin-left:0em;padding-left:0em;text-indent:0em;"><div class="entry"> <div style="margin: 5px; overflow: hidden; height: 65px;"><a style="font-size: 16px; font-weight: bold;" title="'+posttitle+'" href="'+posturl+'"><img class="post_thumbnail thumbnail thumbnail post_thumbnail" style="float:left; margin:0px 2px 0px 0px; cursor:pointer; cursor:hand; border:0" height="65px" width="60px" src="'+img[i]+'"></a><h4 class="post-title" style="margin: 0pt; padding: 0pt; text-align: left;"> <a href="'+posturl+'">'+removeHtmlTag(posttitle,summaryTitle)+'</a> </h4>'+removeHtmlTag(postcontent,summaryPost)+'</div></div> <p class="sp-separator"> </p></li> ';
document.write(trtd);
j++;
}
}
//document.write('<li class="t"><h2 class="t">'+Title1+'</h2><div class="sp-read-more"><a href="'+home_page+'search/label/'+label1+'?max-results=10">more >></a></div><div style="margin: 0pt; padding: 0pt; clear: both; height: 0pt;"></div></li>');
document.write("<script src=\""+home_page+"feeds/posts/default/-/"+label1+"?max-results="+numposts+"&orderby=published&alt=json-in-script&callback=showrecentposts\"><\/script>");
</script> <a href='http://your-url.com/search/label/your-label-here?max-results=10' rel='bookmark'>Read More Posts From This Category</a>
Notes For Script:
- You can upload images tumbnail type (no-image) of your own by replacing the url on imgr[0] or let it remain like that.
- You can change length setting for your article summary and tittle sumary on
summaryPost = 0; // ----> 0 = calculated per-word
summaryTitle = 80; //----> 80 = calculated per-word - You may change for number of your post on such as 4, 5 7 8 etc. in numposts = 4; //
- You must change this with your URL ---> home_page = "http://your-url.com/";
- You must change for your label for example : automotive. That must be same label. Change on code : label1 = "your label"; tLabel1 = "your label";
- You may change for Thumnail area, Code here : <div style="margin: 5px; overflow: hidden; height: 65px; ---->change value for height.
- You may change for widht and height for your thumnail image. Code here : style="float:left; margin:0px 2px 0px 0px; cursor:pointer; cursor:hand; border:0" height="65px" width="60px"
Netter Kingdom
Create Image Thumbnail Your Post on Widget/sidebar
4/
5
Oleh
Sepeda ��