Hey Guys, lets learn how to add auto read more with thumbnail in blog posts. Talking about professionalism, the auto read more gives your blog the look, gets your blog really organized and more beautiful.
What this does is to help you shorten your blog posts automatically and add "read more" link for your reader to click on and see the full content.
The steps requires you to go to your blog template, so save a copy of the template before applying the steps.
Also read
Add Recent Post Widget In Blogger
Add Floating Share Buttons In Blogger (Easy Steps)
Steps
==> Sign into blogger.com dashboard > Select the blog.==> Locate and click on Template > Edit Html
==> Click anywhere in the template and hit Ctrl+F buttons for window, Cmd+F buttons for Mac.
==> Copy the highlighted code below and paste in the search box
<data:post.body/>
==> Press Enter key to find its location in template.
==> You might find the code up to two or three times, please make use of the second one.
==> Replace the above code with the one below
<b:if cond='data:blog.pageType != "static_page"'>
<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/>","<data:post.url/>","<data:post.title/>");</script>
<span class='readmore' style='float:right;'><a expr:href='data:post.url'>Read More »</a></span></b:if></b:if>
<b:if cond='data:blog.pageType == "item"'><data:post.body/></b:if>
<b:if cond='data:blog.pageType == "static_page"'><data:post.body/></b:if>
Note: If you don' t notice any change after you applied its applied, kindly replace the third <data:post.body/> tag too with the code above
==> Now search for </head> in the template and place the code below directly above it
<script type='text/javascript'>==> Save your template, you are done.
posts_no_thumb_sum = 490;
posts_thumb_sum = 400;
img_thumb_height = 160;
img_thumb_width = 180;
</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, pURL, pTITLE){
var div = document.getElementById(pID);
var imgtag = "";
var img = div.getElementsByTagName("img");
var summ = posts_no_thumb_sum;
if(img.length>=1) {
imgtag = '<span class="posts-thumb" style="float:left; margin-right: 10px;"><a href="'+ pURL +'" title="'+ pTITLE+'"><img src="'+img[0].src+'" width="'+img_thumb_width+'px" height="'+img_thumb_height+'px" /></a></span>';
summ = posts_thumb_sum;
}
var summary = imgtag + '<div>' + removeHtmlTag(div.innerHTML,summ) + '</div>';
div.innerHTML = summary;
}
//]]>
</script>
<b:if cond='data:blog.pageType != "static_page"'>
<b:if cond='data:blog.pageType != "item"'>
<style type='text/css'>
.post-footer {display: none;}
.post {margin-bottom: 10px; border-bottom: 1px dotted #E6E6E6; padding-bottom: 20px;}
.readmore a {text-decoration: none; }
</style>
</b:if>
</b:if>
Customization
Modify the number of character shown in homepage there isn't a photo(thumbnail) useing the 490 value in red, to modify the number of character shown when is a photos(thumbnail) in the post, the 400 value in red also.To modify the size of the Thumb, use the values in yellow
160 height and 180 width
Hope It helps, comment if any difficulty.
10 comments
Great post helped alot on empiretechx.com
Hi! Hope you get this but when I added this, for some reason when you get to page 2 of my blog, it stops truncating the blog posts:
https://theworldofmyimagination.blogspot.com/search?updated-max=2019-10-04T04%3A00%3A00-07%3A00&max-results=7#PageNo=2
Just a follow up to my comment, it seems to only happen when posts are "author interviews." Any reason for that?
Okay I think I figured out exactly what happened. It's if any of my blog post titles contain "quotes" or something.
Mercedes service Dubai
Mercedes is one of the luxury car worldwide, when we give our car for repair we have to be very careful on choosing the best Mercedes service Dubai . Don't worry Munich Motor Works is here we offer best Mercedes Car service.We are one of the best car service center in Dubai with high expert staff. https://munichmotorworks.ae
Mercedes service Dubai
Mercedes is one of the luxury car worldwide, when we give our car for repair we have to be very careful on choosing the best Mercedes service Dubai . Don't worry Munich Motor Works is here we offer best Mercedes Car service.We are one of the best car service center in Dubai with high expert staff.
Mercedes service Dubai
Mercedes service Dubai
Mercedes is one of the luxury car worldwide, when we give our car for repair we have to be very careful on choosing the best Mercedes service Dubai . Don't worry Munich Motor Works is here we offer best Mercedes Car service.We are one of the best car service center in Dubai with high expert staff.
Mercedes service Dubai
1xbet korean - Legalbet
1xbet korean. This site uses cookies and other marketing cookies, including to improve your 1xbet free download experience. You agree to our use of cookies to improve your
EmoticonEmoticon