Auto read more functions automatically shorten your post and create a thumbnail of an image which is present in the post.It also helps to load page faster.It also shows and image thumbnails which helps to attract the readers.I have also added the auto read more to my blog.You just have to add two codes to blog no need jquery or css.Now lets see how to add auto read more with thumbnails for blogger.
How To Add Auto Read More With Thumbnails For Blogger ?
- Go to Blogger Dashboard > Design > Edit HTML.
- Now find </head> tag
- Place below code just before/above </head> tag.
<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>
If you want to change image thumbnail size then find these numbers 100 and 120.
- Now find <data:post.body/> and replace it with below code.
<b:if cond='data:blog.pageType == "item"'>
<data:post.body/>
<b:else/>
<b:if cond='data:blog.pageType == "static_page"'>
<data:post.body/>
<b:else/>
<div expr:id='"summary" + data:post.id'><data:post.body/></div>
<script type='text/javascript'> createSummaryAndThumb("summary<data:post.id/>");
</script>
<a class='more' expr:href='data:post.url'>Read more ...</a>
</b:if>
</b:if>
Now save it.
If it doesn't works for you then mention it in comments.I'll glad to help you...
Need Help, I have 2 post bodies, I think I need to replace the first but dont know what to replace, its to large and I dont know which part of it to replace...
ReplyDeletetry the first one if doesn't work then try second...
Deletei too had two post body, replacing the both shows an error
ReplyDeleteError parsing XML, line 1381, column 3: The element type "script" must be terminated by the matching end-tag "".
this data post bodies are only visible while expanding the widgets
ReplyDeletei found error in detail while only replacing the post body no error found but while putting the first code above head
ReplyDeletethe error is fond
error i with the markup script
ReplyDelete@Sreeraj M - thanks for informing me there was little error in the script and I have fixed it now...
Delete@Rahul itz not working replacing the first postbody 2 readmore link appears replacing 2nd postbody no change
ReplyDeleteno readmore button is appearing
working and than'k rahul
ReplyDeleteHello there,
ReplyDeleteThanks a lot for the info. I got this working on my site by using Firefox, Opera, Crome, and safari.
Error on Internet Explorer. It display the No thumbnails image and publish the whole post with read more in the end of the post.
How to fix this?
Is it just me that getting this error on IE?
ops i guess im on the wrong Title. I shoule be on 'Blogger Auto Read More Hack : Improved With Many Control Options' since im using that one
Deleteit doesn't work , can u help me pleas?
ReplyDeleteI have tried this, but facing one problem, Read More is present below the image , see this
ReplyDeletehttp://softclub63.blogspot.com
No tension bro. I have solution about it,Follow below steps,
DeleteFind below code in your template,
]]></b:skin>
add below code just above it,
.more {
margin-left: 450px;
}
Save your template and you are done :)
Thank You Very Much
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteUs this -
ReplyDeletehttp://www.helperblogger.com/2012/06/blogger-auto-read-more-hack-improved.html
i want the thumbnail to be at the top center please help
ReplyDeleteDear admin Rahul Ippar,
ReplyDeleteI want to manage text decoration it display in random order I want to keep them in "justify" and I also want to manage text color, it gives default black color please check my blog business through internet and suggest me please.
This comment has been removed by the author.
ReplyDeleteNo need to change anything just replace first with given code
ReplyDeletesee it working here
thanku so much..@ Rahul
ReplyDeleteOh! you solved my problem. You are a Blogger Genius.
ReplyDeleteThanks.
how to display the read more in right side??
ReplyDeleteAwesome post, it works..
ReplyDeletethis is not working in IE????
ReplyDeletehey iam not geting
ReplyDeleteNice post... Thanks much :)
ReplyDeleteThanx...nyc post
ReplyDeletesoftwaresuneeds.blogspot.in
works perfectly... but how to change post thumbnail image
ReplyDeleteBrother its not working for me Please check my blog
ReplyDeleteHttp://haseebnet.blogspot.com
How do I get this to work in Internet Explorer?
ReplyDeleteit did nto work no changes which data body to replace
ReplyDeletethanks bro this is the best site in the world
ReplyDeleteThanks !
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHi Rahul,
ReplyDeleteThanks a lot its working.
I change the pic size to 600x430... the size that I prefer, but there is one prob...
atm the text was beside the pic. Which look so weird..
What coding should I change to make the text under the image?
Thanks
Thank you so much.its what i've searching for.
ReplyDeleteRead More button with image thumnails.
Cature Your Dream
it doesnt even allow you to copy the code!!!!!
ReplyDeleteIf you are using chrome
DeleteRight click on the box which includes the code and choose inspect element.
Expand the code tags in inspector
Right click and choose edit as text.
Copy it.
If you are on firefox I do think it has a plugin called FireBug which allows you to do the same thing as Chrome's Inspector.
Helpful article...me used in below blog
ReplyDeleteJaysukh patel recently posted : Android latest update for android user.
http://android-tweet.blogspot.com
This comment has been removed by the author.
ReplyDeleteboss it does not work in my blog
ReplyDeleteplease help
my blog http://techsitebd24.blogspot.com/
Hi Rahul,
ReplyDeleteIt is not working on my blog..
http://readlock.blogspot.com
Please check