Sunday, August 16, 2009

Publish only summaries of your blog post

  • Now we have something similar for blogger.
  • Actually i should say it is really amazing.
  • This hack will automatically create post summaries with thumbnails & read more button.
  • you needn't need to add any extra code in every blogpost that you make.
  1. First of all edit your blogger template (In Blogger, click Layout --> Edit HTML)
  2. Find the text " <head> "
  3. Put following code after <head>
<script type='text/javascript'>
var thumbnail_mode = &quot;float&quot; ;
summary_noimg = 230;
summary_img = 140;
img_thumb_height = 100;
img_thumb_width = 100;
</script>
<script src='http://blogergadgets.googlecode.com/files/excerpt.js'
type='text/javascript'/>

Find the paragraph with following line

Replace it with following lines

<b:if cond='data:blog.pageType == &quot;item&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 style='padding-top:5px;;float:right;text-align:right;'>
<a expr:href='data:post.url' rel='bookmark'><b>
Read more >></b></a></span>

</b:if>

Your post would look similarly like below:

No comments:

About This Blog

Lorem Ipsum