This hack was written before the introduction of Blogger jump-break (read more) feature. Blogger jump-break doesn’t have this bug.
As you may notice many blogs use “read more” (a.k.a. expandable post) thingy on their homepages. For readers who are unfamiliar with this feature, what a read more function does is when you are at the homepage (or any index page), only post snippets are displayed, the rest will be hidden. When you click the “Read more” link it will transfer you to the post page, and shows the post in full.
This read more hack enables blog owners to put multiple posts in the homepage without using too much space. Visitors will appreciate this because the can scan through the entire homepage with less scrolling.
Most read more codes out there come with a bug, the “Read more” link will show up on all posts, even if you don’t want it to (by not defining the
id=”therest” in the post). The read more function I’m going to show you has been sanitized so to speak, so it’s free from the said bug/annoyance.
So here it goes:
- Login to your Blogger account.
- Go to Dashboard > Design > Edit HTML.
- Back up your template.
- Tick the Expand Widget Templates check box on top right of the HTML window.
- In the code window, look for this line:
- Replace the line with the code below:
(Update 19 June 2009: Minor changes to the code to prevent duplicate content in generated source code.)
- To make the code to work, you have to define the id=therest part of your post. To do this, go to post editor. in HTML mode, insert these tags inside your post:
<span id="therest">and its closing pair
</span>. Position the tags as shown below. Note: The id name “therest” can be changed to any name of your choice, as long as you change them in all three places: inside the post, inside the style tags and inside the script.
- Repeat step 7 for other posts.
- Click Preview. If it works, then click Save Template.
That’s it, enjoy!