Thứ Bảy, 5 tháng 12, 2009

Automatic Read More Hack With Thumbnail for Blogger Bug Fixed




Superb Automatic Thumbnail Read More Hack For Blogger / Blogspot.. This Hack By Me is 100 % Working On Any template you Use. Simple To Install No Javascript So Your Blog With Load Faster Than Before..


Advantages Of This Hack
  • It Automatically Displays Images From Your post and than Your Post Content
  • No Need To Add Any Code To Your Post
  • No Need To Update Your Old Post
  • Fancy Read more Image . Check The Screenshot above
  • No Javascript So Your Blogs Open Faster
  • Is 100 % compatible with Every Blogger Template
Now Lets See How To Do This

  • Login To Blogger
  • Go To Layout ---> Edit Html
  • Click On Expand Widget
  • Now Find The Code </head> and pate the below code above it
<script type='text/javascript'>var thumbnail_mode = "no-float" ;

summary_noimg = 430;

summary_img = 340;

img_thumb_height = 100;

img_thumb_width = 120;

</script>

<script type='text/javascript'>

//<![CDATA[

function removeHtmlTag(strx,chop){

if(strx.indexOf("<")!=-1)

{

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);

}

}

strx = s.join("");

}

chop = (chop < strx.length-1) ? chop : strx.length-2;

while(strx.charAt(chop-1)!=' ' && strx.indexOf(' ',chop)!=-1) chop++;

strx = strx.substring(0,chop-1);

return strx+'...';

}





function createSummaryAndThumb(pID){

var div = document.getElementById(pID);

var imgtag = "";

var img = div.getElementsByTagName("img");

var summ = summary_noimg;

if(img.length>=1) {

imgtag = '<span style="float:left; padding:0px 10px 5px 0px;"><img src="'+img[0].src+'" width="'+img_thumb_width+'px" height="'+img_thumb_height+'px"/></span>';

summ = summary_img;

}





var summary = imgtag + '<div>' + removeHtmlTag(div.innerHTML,summ) + '</div>';

div.innerHTML = summary;

}





//]]>

</script>




  • Now Find The code <data:post.body/> and replace it by below code
<b:if cond='data:blog.pageType != "item"'>





<div expr:id='"summary" + data:post.id'><data:post.body/></div>

<script type='text/javascript'>createSummaryAndThumb("summary<data:post.id/>");

</script> <span class='rmlink' style='float:right;padding-top:20px;'><a expr:href='data:post.url'><img src='http://i37.tinypic.com/351icqx.jpg'/></a></span>





</b:if>

<b:if cond='data:blog.pageType == "item"'><data:post.body/></b:if>
  • Click Save Template .. You are Done
Explanation Of This Hack

summary_noimg = 430; is text count cut height without image
summary_img = 340; is text count cut height with image
img_thumb_height = 100; is height of image to Show
img_thumb_width = 120; is Width Of Image To Show


You Can Also Change The Read More Image To Text You Want Just Replace The code
<img src='http://i37.tinypic.com/351icqx.jpg'/> with Your Text

Player

0 nhận xét:

Đăng nhận xét

Bạn có ý kiến hay thắc mắc về bài viết --> Hãy để lại nhận xét bên dưới !

Phản hồi của bạn luôn được đánh giá cao. Tôi sẽ cố gắng trả lời sớm nhất có thể.
Nhắc bạn:
1. Vui lòng đừng Spam ! Tôi sẽ xóa ngay lập tức nếu phát hiện.
2. Các bài comment phải nghiêm túc, không dung tục.
3. Nội dung phải liên quan tới chủ đề bài viết.
4. Hãy để lại tên của bạn khi bạn post bài comment, để mình có thể dễ dàng trả lời comment của bạn khi cần.
5.Đối với những thắc mắc không liên quan đến bài viết này, bạn vui lòng để lại câu hỏi ở đây --> PC Help

Thân chào,
Admin

  Sản phẩm mới của KNC