Show Mobile Navigation
,

Automatic Read More Hack in Blogger With Thumbnail

Hemant Verma - 11:24 AM

When we start our blog and post 2-3 posts and when we see our blog in home page then by default blogger shows the full posts in the home page by we all want to know show that blogger should show half content in the home page and rest is show in the whole post. So, it’s better to give a summary of your posts on your blog’s homepage and then add a ‘read more’ link below that post summary. In this Blogger Tutorial i have a script that automatically converts your posts into read more summary in your blog homepage.


Demo of Read More hack




Installation of Read More Hack

  • Login to Blogger > Dashborad
  • Click on Drop Down Menu and select Template
  • Backup your Template before making any changes to your blog
  • Now Click on Edit HTML 
  • Press Ctrl + F and search the code shown below.

</head>

  • Paste below code before </head>

<script type='text/javascript'>
//<![CDATA[
function removeHtmlTag(a,b){if(a.indexOf("<")!=-1){var s=a.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)}}a=s.join("")}b=(b<a.length-1)?b:a.length-2;while(a.charAt(b-1)!=' '&&a.indexOf(' ',b)!=-1)b++;a=a.substring(0,b-1);return a+'...'}function createSummaryAndThumb(a){var b=document.getElementById(a);var c="";var d=b.getElementsByTagName("img");var e=summary_noimg;if(d.length>=1){c='<span style="float:left; padding:0px 10px 5px 0px;"><img src="'+d[0].src+'" width="'+img_thumb_width+'px" height="'+img_thumb_height+'px"/></span>';e=summary_img}var f=c+'<div>'+removeHtmlTag(b.innerHTML,e)+'</div>';b.innerHTML=f}
//]]>
</script>
<script type='text/javascript'>
summary_noimg = 550;
summary_img = 450;
img_thumb_height = 150;
img_thumb_width = 200;

</script>

  • Now find below code

<data:post.body/>

  • Replace it with  below code

<b:if cond='data:blog.pageType == &quot;item&quot;'>
 <data:post.body/>
<b:else/>
<b:if cond='data:blog.pageType == &quot;static_page&quot;'>
<data:post.body/>
<b:else/>
<div expr:id='&quot;summary&quot; + data:post.id'>
<data:post.body/>
</div>
<script type='text/javascript'>createSummaryAndThumb(&quot;summary<data:post.id/>&quot;);</script>
<div style='clear: both;'/>
<span class='rmlink' style='font-weight:bold;padding:6px;float:right;text-align:right;'><a expr:href='data:post.url' >Read more</a></span>
</b:if>
</b:if>

  • Now Save your template.

 Make Changes....! (Optional)



summary_ noimg= 550; >> Length of the summary if the post does not have a thumbnail.
summary_img = 450; >> Length of the summery if the post have a thumbnail
null_thumb_height = 150; >> Height in pixels of the thumbnail.
null_thumb_width = 200; >> Width in pixels of the thumbnail.



If Any Problem Comes, Ask in Comments


46 comments:

  1. Hi...bro
    Thank you,
    I applied this to my blog and it is working fine. but i just want only image to be appear in the center, no words.

    Can you give me the code please..

    Thank you in advance..

    ReplyDelete
  2. @shree aixI will try to fulfill your request.

    Thanks for applying this.

    ReplyDelete
  3. Thank you very much for this tutorial. I have applied it on my blog http://apk3.blogspot.com/.It works like a charm. I need one more thing & it could make it even better. Text are not showing in a justifying manner before read more button. If you look after this issue & give me that update I will be even more grateful to you. Thank u once again.....

    ReplyDelete


  4. this code is present three time in blog.i have try in all one by one but not working.

    ReplyDelete


  5. this code is present three time in blog.i have try in all one by one but not working.

    ReplyDelete
  6. @Malik Numansend me your template

    vhemant03@gmail.com here

    ReplyDelete
  7. Mr. Hemant Verma, Texts are not showing in a justifying manner before read more button. I am waiting for your response...

    ReplyDelete
  8. @Malik NumanIt's working on template also.

    | Demo |

    Check Your Inbox template send you.

    ReplyDelete
  9. This is my blog URL: http://www.apk3.blogspot.com/

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. How do you make the thumbnail image larger? Also is there a way to let it show more of the summary rather then just a line?

    ReplyDelete
  13. thanks, i appreciate that !... Nice n simple

    ReplyDelete
  14. Thank You Very Much Bro! I Used Your Technique And Its Working!!
    This Is My Link..Http://Infoaday.Blogspot.Com/
    The Ctrl+F That You Suggest Was Most Helpful..

    I Just Having Difficulties With
    "Replace it with below code."
    It Should Be:
    "Replace ALL OF IT IN THE TEMPLATE with below code."

    By The Way, Thanks Again!

    ReplyDelete
  15. @Syaiful IzwanFollow the below steps...

    1. This is very simple you have to find this code <data:post.body/>
    2. Delete this code <data:post.body/>
    3. and finally Paste below code where you delete <data:post.body/> this code.

    <b:if cond='data:blog.pageType == &quot;item&quot;'>
    <data:post.body/>
    <b:else/>
    <b:if cond='data:blog.pageType == &quot;static_page&quot;'>
    <data:post.body/>
    <b:else/>
    <div expr:id='&quot;summary&quot; + data:post.id'>
    <data:post.body/>
    </div>
    <script type='text/javascript'>createSummaryAndThumb(&quot;summary<data:post.id/>&quot;);</script>
    <div style='clear: both;'/>
    <span class='rmlink' style='font-weight:bold;padding:6px;float:right;text-align:right;'><a expr:href='data:post.url' >Read more</a></span>
    </b:if>
    </b:if>

    ReplyDelete
  16. hey folk
    read more text is not coming in my blog please look once

    http://employmentsportal.blogspot.com

    ReplyDelete
  17. This code couldn't work in my site..,
    what should i do..?
    my blogger site: http://allexamsinfo.blogspot.com/

    ReplyDelete
  18. I am trying to do this with my blog, but for some reason I can't find this code when I do ctrl F:

    Am I doing something wrong??

    ReplyDelete
  19. @Sloppy Copy Mommy

    My comment isn't showing the code I couldn't find...It's the 2nd part of the code,

    ReplyDelete
  20. @Sloppy Copy MommySend me your template I will do it.

    vhemant03@gmail.com

    ReplyDelete
  21. Not works :( My blog: http://ultimoaggiornato.blogspot.it/
    Could you help me? Thanks in advance..

    ReplyDelete
  22. I Have followed all your steps it's not working

    website is : http://www. onlinetechtricks.com

    but it is working well in

    www.demoblog786.blogspot.com

    ReplyDelete
  23. @Hemant Verma

    Hello !
    which website template I have to send ?

    Working one or not working template

    ReplyDelete
  24. @Hemant Verma

    Hello Hemant


    I have attached my template to your email address. Please Check and sort my problem as soon as possible.

    Thanks In Advance

    ReplyDelete
  25. @Syed Muhammad Kashan Ul Hassan NizamiPlz send me again your template be'coz your mail had been deleted accidentally.

    ReplyDelete
  26. I again send you the email. Please check

    ReplyDelete
  27. @Syed Muhammad Kashan Ul Hassan NizamiNow it's working well


    Live Demo: http://chking-wg.blogspot.com

    Download your template here: https://docs.google.com/file/d/0BwLlzxLZAnSbLXNxODZQWW9GUFk/edit?usp=drive_web

    ReplyDelete
  28. hi, its not also working on my blog. i will send my template to your email.

    ReplyDelete
  29. hi, its not also working on my blog... help buddy!

    ReplyDelete
  30. @Anonymoussend me your template here

    vhemant03@gmail.com

    ReplyDelete
  31. I cant find on my template. pls help

    ReplyDelete
  32. hi! can you fix my template for me?

    ReplyDelete
  33. @kulasa zenSure Send your template here vhemant03@gmail.com

    ReplyDelete

You may use these HTML tags and attributes: <a href="" title=""> </a> <b> </b><strong> </strong>

 



Make Your Blog Like a Pro
About | Contact | Affiliates | Privacy Policy | TOS