Automatic Read More for your blog

This tutorial will help you to insert in your blog a automatic read more.

We have to choose the number of characters after which the post will be truncated. If we choose 400, only show the first 400 characters.

Here we go:

STEP 1:
Log in to Blogger, and go to Layout->Edit Html and mark the Expand widget templates Box.


Now find (you can use Ctrl+F, to search it faster) this template code:
</head>


And insert before that code, the next code:


<script type='text/javascript'>var thumbnail_mode = &quot;no-float&quot; ;
summary_noimg = 500;
summary_img = 450;
img_thumb_height = 100;
img_thumb_width = 120;
</script>
<script src='http://files.main.bloggerstop.net/uploads/3/0/2/5/3025338/read-more_auto2.js' type='text/javascript'/>

You can change the items in blue. If your post dont have a image, then it will show 500 characters.


STEP 2:
Now we have to find this code
<data:post.body/>


And replace it, with this 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>
            <div style='clear: both;'/>
            <span class='rmlink' style='float:right;padding-top:20px;'>
                <a expr:href='data:post.url'> Read More... <data:post.title/> </a>
            </span>
    </b:if>
</b:if>






Now save the template, and enjoy your read more.


Note: How you can see, the JS file, is in that location, but i suggest you, to download and save it somewhere else, because we never now.


Upload the file to :
I recommend this one MyDataNest

NOTE: You must set your folder as 'Hidden' and not 'Private', and after that is copy and link and paste it in your code.



Source: http://bloggerstop.net/2009/05/automatic-read-more-hack-for-blogger.html



0 comentários:

Enviar um comentário