2009-03-27

Image

How to add " Read more " to your blogger homepage posts ?

One good way of increasing your page views is to display summary of your posts and adding a read more link to the end of post summary so that viewers will navigate to the post page and read the complete article . In wordpress , it is quite easy to do that . But How will you do that in Blogger ? So , How to add " Read more " to your blogger homepage posts ?
Follow the steps below to add Read more to your blogger posts !!

  • Login to your Blogger dashboard and navigate as follows : Layout -- > Edit HTML .
  • Now select " Expand widget templates " by putting a tick on checkbox .
  • Click on Download full template and save your Template so that you can restore it if you find any problems .
  • Now find , <data:post.body> </data:post.body>and replace it with the following piece of code .

<b:if cond='data:blog.pageType != "item"'>
<div expr:id='"summary" + data:post.id'/>
<script type='text/javascript'>
var blogID = "Your Blog id";
function retriveSummaryPost<data:post.id/>(json){document.getElementById("summary<data:post.id/>").innerHTML
= json.entry.summary.$t + "..."}
function CreateSummaryTechnade<data:post.id/>(POSTID){ var script =
document.createElement("script");
script.src = "http://www.blogger.com/feeds/"+blogID+"/posts/summary/"+POSTID+"?alt=json-in-script&callback=retriveSummaryPost<data:post.id/>";
script.type = "text/javascript"; document.getElementsByTagName('head')[0].appendChild(script);
}
</script>
<script type='text/javascript'>
CreateSummaryTechnade<data:post.id/>("<data:post.id/>");
</script>
<span class='rmlink' style='float:right'><a expr:href='data:post.url'>-->Read more...</a></span>
</b:if>
<b:if cond='data:blog.pageType == "item"'>
<div id='post_body'><data:post.body/></div>
</b:if>

  • Now replace Your blog id in the above code with your blog 's id . Dont know how to get your blog ID ?? Its simple . Just see the URL of your page which will look something like this

    http://www.blogger.com/html?blogID=6813955933254343526&tpl=true

In the above URL letters in blog is the blog ID .

  • Save your template and you are done . Quite simple right ?

0 التعليقات:

Total Pageviews