70 How to add Blogger's Read More function to customized templates
September 11, 2009 /


As announced yesterday, Blogger have now enabled selective post summaries for our blogs. This means we can add a "jump break" in our posts, after which any content will only be visible on item pages.

Those of us using customized templates will probably need to add the code required for this function to work. In this article, I'll explain how easy this is to implement, as well as some helpful hints for customizing the "Read More" link.

Will the "Read More" feature work for my customized template?

For most Blogger users, adding the code required for Blogger's post summaries will enable selective summaries without error, even if you've already added the code to summarize your posts using the <span class="readmore"> hack.

The only templates this method will not work with is those which have added an automatic post summaries hack, which summarizes the posts based on the number of characters or words. This is because such customizations ignore any code added to the body of our blog posts and don't register Blogger's Jump Links.

If you'd prefer to use Blogger's Read More function than your current automatic post summaries, the simplest way to adapt your template is to remove references to the post summaries script - anything between the <script> and </script> tags used for your particular method.

If in doubt, refer to the author of the particular version of this script you are using.

How to add the code required for Blogger-powered post summaries

In order to add the "Read More" function to a customized template, we only need to add a few lines of code to our template's HTML.

If you're adding this code to your blog template, it is best to first add a new (or test) post in which a Jump Link is added. This ensures we can check our template customization to ensure everything works well beore saving.

To add a blog post with a Jump Link...

Simply create a blog post using Blogger's new post editor. This can be done either through Blogger in Draft, or by enabling the new post editor in the Settings>Basic tab of your Blogger dashboard.

Alternatively, you can edit your post in Edit HTML mode, and type <!-- more --> where you'd like the jump link to appear.

Ensure you have some content both above and below the Jump Link. Then publish your blog post.

If Jump Links have not already been enabled in your template, the post will appear in full. In this case, continue reading to learn how to add the code for Jump Links to your Blogger template code.

To add the code for Jump Links functionality to your Blogger template...

Go to Layout>Edit HTML in your Blogger dashboard and ensure you have checked the "Expand widget templates" box.

Then using your browser's search function, locate the following line of code:
<data:post.body/>
Depending on your individual template, you may find this enclosed between <p&gt or <div> tags. We need to leave these tags intact.

If you've added any other "Read more" hacks to your template (or have added other conditional statements to the Blog Posts section), you may discover more than one instance of <data:post.body/>. If this is the case, you need to edit the section which has <b:if cond='data.blog.url != data:blog.homepageUrl> a line or two above this.

Immediately after the <data:post.body/> line, add the following few lines of code:
<b:if cond='data:post.hasJumpLink'>
<div class='jump-link'>
<a expr:href='data:post.url + "#more"'><data:post.jumpText/></a>
</div>
</b:if >
Then preview your changes. If this has worked properly, your test post should display only the content added before the Jump Link. If you receive errors, or this technique did not enable the summaries, clear your edits, check the code you've added and begin again.

Styling the "Jump Link" and other interesting ideas

Now that we have "jump links" enabled by default in our Blogger templates, there are some useful and interesting tricks we may do to style the actual link and other properties of summarized posts.

Here's a few ideas to get you started.

Change the "Read More »" text

This is the simplest customization we can make. Simply go to Layout>Page Elements and click the "Edit" button for your Blog Posts gadget.

On this pop-up page, you can alter the text to something more suitable if desired.

Styling the "Read More » text

The "read more" text (or whatever phrase you may have changed this to) is enclosed in a <div> with the class of "jump-link". This enables us to add CSS to our <b:skin> section to affect the style of this particular link.

For example, the following CSS will give the Jump Link a red background, with white text and 3px of padding, thus overriding any other style statements for any instance of this particular link:
.jump-link a {
background: #ffff00;
padding: 3px;
color: #fff;
}
We could also add a :hover property with different colors for the background and text to create a different effect when a reader hovers over the "read more" text:
.jump-link a:hover {
background: #000000;
padding: 3px;
color: #ccc;
}
If you're fairly confident with CSS, you could easily adapt these examples to include background images, rounded corners, and indeed any property which would work with a link in the post.

Replace "Read More &raquo" with an image

Those who would prefer to use a linked image instead of a plain text link can replace <data:post.jumpText/>  with image tags, like this:

<b:if cond='data:post.hasJumpLink'>
<div class='jump-link'>
<a expr:href='data:post.url + "#more"'><img src="url_of_image" border="0" alt="Alternative text" /></a>
</div>
</b:if >

Where "url_of_image" is the true URL of your image as hosted by your image provider (Picasa Web Albums is my current preferred option, and free to boot!).

Display image "thumbnails" on non-item pages

I rather like the hacks which enable automatic post summaries with image thumbnails, so was very interested to see if a similar solution can be used along with our Blogger Jump Links.

Unfortunately, our summarized posts do not (yet) offer an extra class to which we can add attributes for images displayed within them. Instead, we can use some conditional CSS to alter the size (and alignment) of images on non-item pages.

Here's the work-around I've successfully used so far:

Go to Layout>Edit HTML and locate the closing ]]</b:skin> tag using your browser's search function.

Immediately after this line, add the following code - adapted to your personal preferences of course:

<b:if cond='data:blog.pageType != &quot;item&quot;'>
<style>
.post-body img {
img {
max-width: 100px;
width: expression(this.width > 100 ? 100: true);

float: right;
}

<style>

</b:if>


Change 100 to a different dimension if you prefer your images to be wider or narrower than 100px.

If you prefer images to be aligned to the left, you can alter float: right to float: left instead. Delete this line altogether if you'd prefer the image to appear in the same alignment as specified in your post.

This technique is a variant of Blogger Tricks' Larger HQ Images hack, but instead of enabling wider images, we're using this to create thumbnails. By using the max-width property and omitting any references to height, we ensure images smaller than the specified width will not appear distorted.

To use this technique, ensure you add an image close to the top of your post, before the Jump Link. On non-item pages, this image will appear no wider than your specified width.

Issues with the sidebar shifting beneath blog posts after adding Jump Links to posts

Many people have reported that their blog's layout appears distorted after adding Jump Links to their blog posts. For some layouts, the Jump Link causes the sidebar to shift beneath the blog post, as though the link is outstretching the boundaries of the post section.

In the comments of my announcement post, N@k$h@tr@! explained that this is because the Jump Link is somehow inserted between the opening and closing DIV tags in the HTML of a blog post.

N@k$h@tr@! recommends to view any posts to which Jump Links have been added in Edit HTML mode and delete any <div> and </div> tags you find (full details may be found on this blog post).

The Blogger Team are aware of this situation, and I assume this glitch will be resolved soon.


What do you think of this new function, and possible customization techniques?

I hope this article fully explains how to add functionality for Jump Links to customized Blogger templates, and offers some insights as to how we can further customize the appearance.

Please feel free to let us know your opinions and any ideas for further customization of the Jump Link and summarized posts by leaving your comments below.

Image credit: clspeace

70 Comments:

11 September 2009 21:57 Fina said...

thank you! :)

11 September 2009 22:08 Drew Kime said...

I was thrilled to hear about the new functionality, until I saw how it was implemented. In my variation of the Read More hack the whole post is there, but the bulk of it in a hidden div. The link just flips the display property. That means the content appears in the same page, and is instant with no round-trip to the server.

I wouldn't mind the trip to the server, since initial page load would be faster, but I don't want to go to the detail page. I want it brought up in place.

I guess I'll keep using my hack and waiting for Blogger to support a more AJAX-ified version.

11 September 2009 22:25 TeknoMobi said...

Thank you Amanda :)

12 September 2009 00:55 Adam @ Low Tech Combat said...

Hey Amanda, thanks for the tips. I have tried adding jump breaks to posts from my homepage. The jump break is there OK but there is no 'Read More' link at all. The post just ends where the jump break is supposed to be.

Hopefully I will be able to get this working as I have been waiting out for Blogger to get this going officially after your 'heads up' not too long ago.

Keep up the good work!

12 September 2009 01:02 crazyseawolf said...

Amanda, there's no need to delete div tags. Put an opening and closing div tag before and after insert jump break feature:

[div]short text [/div]
[!-- more --]
[div]rest of the post [/div]

I used [] instead of <>.

12 September 2009 01:08 Adam @ Low Tech Combat said...

just followed the link you provided, all good now! thanks so much!

12 September 2009 02:47 Christian Schnitt (Stulles Weblog) said...

Nice thing, i have the hack for 3 Days and think the text must be bigger than the rest of post text.

12 September 2009 08:38 Lonelytribe85 said...

Thank you so much... now I save more space in my post page...

12 September 2009 13:41 N@k$h@tr@! said...

Hi Amanda,
Thanks for mentioning my name and linking to my post :)

12 September 2009 13:42 N@k$h@tr@! said...

My name is Swathi Pradeep btw :)

12 September 2009 14:49 Dilip Acharya said...

Hi! Amanda,

I've been visiting your blog since quite a long time and learning several tricks from you. I always admire your effort and thanks for the same.

BTW, I just tried to play with the blocks of codes you have provided to "Display image "thumbnails" on non-item pages"

At first I got err message and it worked only after I changed the closing "style" from <style> to </style> .

Just informing you....
Regards!

13 September 2009 08:51 Adam said...

Cannot get the image thumbnails to work. Did what Dilip suggested by changing to < / style> (without the spaces...) so all the coding was accepted but on the main page, there are no thumbnails, still full images as in the individual posts.

Is there something I can do to fix this?

Loving how Blogger is improving! Read More and thumbnail images gives a much better front page, more magazine style :)

If anyone can help would appreciate very much!!!

13 September 2009 10:02 Rizwan Ibrahim said...

Same problem like Adamn is happening with me.

Everything is done..

But still the thumbnail isnt appearing in the left nor the right side..

Just d same as before!

www.tricksterminal.com

Any Way to help?

13 September 2009 15:01 IEDig said...

IEDig is a social content website where your readers or you can
submit content to. If you have a good story, members will 'Vote' the post
and write comments. As a blog owner, you may want
to make it easy for and encourage your readers to Visit on Your Blog.


Join IEDig.com

13 September 2009 16:22 Rafay Baloch said...

How to hack facebook passwords and recover lost facebook passwords
http://rafayhackingarticles.blogspot.com/2009/07/how-to-hack-facebook-account.html

14 September 2009 03:53 ASNA said...

Thx 4 Info

http://sizzledsoft.blogspot.com

14 September 2009 06:18 A. Manaf said...

I want to display the post title in TITLE attribute of "Read more" link, so when the link is hovered, the text e.g. "Continue reading [POST TITLE]" appears. How can I do that? Thanks.

15 September 2009 11:54 eBIZ.com Pvt Ltd Diary said...

Hey Amanda,
Thnx 4 the grt post. But I've a problem. I use custom template and so had to add the code after the [data:post.body/] but in my blog the "Read more" text doesn't show in my home page.

The text below the jump-link along with the jump-link(Read More hyperlink) are missing !!!!

I scanned all the comments here but dont see nebody else having the problem.

Please help :)

15 September 2009 12:05 SMS Cookbook said...

@ebiz I saw ur blog ... may be u r using a [if:cond ... tag for differentiating ur item n non-item pages ... if u r then add the code for non-item page only.

Try n see if that works. Peace.

15 September 2009 12:07 eBIZ.com Pvt Ltd Diary said...

Wow that was fast ... btw it does work now ... thnx @smscookbook :)

16 September 2009 08:58 Rolf Blijleven said...

Hi,
You might want to check this out for a toggable text block script.

http://rolfblijleven.blogspot.com/2009/09/test.html

It's just one javascript to call as many times as you like, and you pass it the id of the text-to-toggle, plus the text of the turn-on and turn-off text for the link.

Cheers!

17 September 2009 14:40 sundowndos said...

Hi Amanda,

I seem to have the same problem as Adam did earlier in this comment trail. I have one of the default blogger templars. So I shouldn't have to add any code. But when I a jump link. It does truncate the post. But there is no "Read More >>" link. Please help. Thanks.

18 September 2009 10:27 Pinoy Hoho said...

Problem:
I have installed the read more hack to my blog. It turned out fine: i have auto summaries, auto-generated thumbnail and read more link. However, for new posts, the thumbnail won't show up. What could be the problem for this? My blog is http://myxlist.blogspot.com.

19 September 2009 04:23 FIRDAUS said...

its not working,Y?

19 September 2009 09:53 Rafiq Raja said...

Amanda: Nice article regarding the new Blogger feature, which was long expected.

But, just to clear out a doubt, does this bloggers own method, avoids all the content getting loaded and hidden beneath the jump link, like it's the case for the other read more hacks ?? I would love to have the summary pages kind of used in wordpress, where only the summary loads in index pages, and then the full post upon clicking the button, which will let the home page load faster than ever.

Has this new feature of Google/Blogger, achieved that feat (I doubt since it is still using div tag layers here too) ???

20 September 2009 23:28 Bang Del said...

This is great..Blogger has a new feature again.. Thanks Amanda.

21 September 2009 12:28 sasi said...

Amanda,I am not able to stye my 'Read more' text,by changing the color of text.please help.

1 October 2009 08:00 tikoim said...

Great! Was looking for some read-more-as-image css code. Hope Blogger will fix the sidebar shift soon - at my blog one --more-- tag works fine - but a second brings up a bug - lets see
thx

6 October 2009 04:39 Milton Ramirez said...

How can I get the 'read more' floating or aligned on the right side of post? The problem is presentation. I want to keep the feature but I don't want to mess with the paragraphs space.

Ideas?

7 October 2009 20:42 It was all a Dream said...

Amanda I'm having problems with my "Read More" link posting twice. Any suggestions. Fegonomics.blogspot.com.

9 October 2009 08:41 Neil said...

Hey amanda. Your blog is really nice. And its working in my blogs too. But I'm facing a few problems. Like, when I'm inserting a page break in my older posts, and republish it, all the gadgets in the right sidebar is shifting under the blog.. Can't figure it out. Can you help me?

p.s-> if possible please mail me at delscarlet@gmail.com

Regards.

10 October 2009 11:52 Mike said...

Zillion thanks!!! :))

15 October 2009 10:50 Shekhar Sahu said...

Thanks a lot, otherwise i was going to do it manually for each.

18 October 2009 12:43 ed said...

Hi Amanda,

Thanks for the tips. I used the replace-with-image suggestion.

Thanks again :)

ed

24 October 2009 04:01 Rajiv said...

Thankx Dear...

26 October 2009 17:15 nada said...

info yg keren sob
keep update ya

31 October 2009 06:51
Anonymous said...

Would like snapshots or image sample of the steps. thanks

7 November 2009 17:35 Sanatate said...

Big thanks. Very useful

7 November 2009 21:07 Amanda said...

Hmm guessing by reading the tutorial, this feature doesn't work for blogger blogs hosted via FTP?

11 November 2009 07:57 Dwi said...

nice post my friend..., but i can use it.

13 November 2009 16:40 Matt 'Cliff' Clifford said...

Hey thanks for the top info! I just wrote a site about useful blog advice websites and I included this page on it.

Check it out here: http://mattcliff.blogspot.com/2009/11/hot-to-get-more-blog-hits.html

If you could link back to my page that would be great!

Matt

14 November 2009 20:25 Fritz and Scott said...

I can't find either "Expand widget templates" box in blogger OR "...data:post.body..." within my HTML code.

15 November 2009 00:52 ronie said...

thank you amanda, finally i found this trick.

17 November 2009 13:52 N@k$h@tr@! said...

Hi Amanda,
Is Google working on this issue right now?
Many of the bloggers are finding it a tedious job to remove the div tags to prevent shifting of sidebar to the bottom.

It would be really nice if google can fix this issue ASAP :)

25 November 2009 02:02 albani said...

Thank for the tutorial, but there was a problem in saving pdf file, there is truncated article, how can i fix ?

1 December 2009 17:42 shin0bi said...

Hi and thanks for the tips!
One minor problem:
What if you have many authors in your blog ( not admins) and they can not change the post editor to the new one. What can we do???
Only type !-- more -- in EDIT HTML mode???
Is there any way to bring up the new post editor for them too??
Thanks

2 December 2009 18:51 Zaid Khan said...

Thanks a lot for your instructions. Your posts have been very helpful.

Could you also help me with styling the 'read more' thing? I am not able to grasp that and failed while changing the colour of 'Read more' text.

My 'Read More' text is Blue in colour, whereas I would like to have it in a colour that matches with my Blog's theme [green or something].

Your quick reply would be greatly appreciated.

28 December 2009 04:57 Apryl @ Christian Clippers said...

Thanks sooo much! This was driving me nuts

3 January 2010 03:14 LaLicenciada said...

I have a custom template and followed instruction on blogger buster to add a "read more" function. Blogger has the "Jump links" now and I want to get rid of the prior customization because they seem to conflict with eachother - it takes a lot of tweaking each post to get it to work and at the end of the day, i have 2 "read more" links at the end of an abbreviated post. HELP!
HerDeepThoughts.com

9 January 2010 05:44 KG said...

I followed the instructions and my blog no longer shows up in Chrome or Firefox.

13 January 2010 15:10 Ika said...

thank you very much....

now the link read more in my post just shown if I broke the page....before I used your tips, read more always appear although I didn't break the page.....

14 January 2010 04:31 Engr. Cesar Noel said...

I think you don't need this one as blogger.com has already updated their post editor which includes the "read more" feature and other cool features

23 January 2010 03:44 Viral Marketing said...

Thanks Amanda ... it really helpful ... :)

2 February 2010 21:10 Adda said...

Thanks sooo much!

6 February 2010 15:44 Anara said...

I got a hack for this from another blog (Blog Doctor), and it works great except "read more" appears in every post. If I have a short post, I think it's tacky to have read more when there is no more, and I sure don't want to make readers click to get one more sentence.

Is there a way to insert the read more text directly into the code of the post, so I can decide when I do or do not want to use this function?

7 February 2010 02:04 Mc | solve shutdown problem said...

Hi Amanda... I've got my own problem here on my Blog, my "Read more.." always show up at the end of my posts although I never "hacked" or use the Read more function from my blogspot posts. Can you tell me "How to get rid of it?"... Thanks.

8 February 2010 08:06 The Holistic Diva said...

Wow, unfortunately this completely messed up my blog, the side bar is below the posts, and removing the code for the Jump Link has not restored my side bar to the proper position.

Now in my layout, the posts widget extends across the width of my blog. Anyone have the same thing happen or have any ideas for a resolution? Stupid idea on Blogger's part because this doesn't work with custom templates, even with their "fix."

14 February 2010 17:14 faraz said...

Very nice widget..

Its works..

19 February 2010 00:11 Gordon Wales said...

Amanda - Thanks so much for the 'read more' advice, which I implemented, but unfortunately though I can now click on 'read more' at the cut off in my posting all that happens is that I skip back to the the top of the original post. I can keep on clicking and turn it into a game! It goes round, and round, and round going nowhere but home! I have tried over and over again in the HTML to alter it, but am at a loss as to what I should do now. Sorry to bother you with this, but I do have a problem. I was wondering if this has happened to any one else.
And might I add a thank you for the incredible patience and the gift of your vast knowledge that you give to all of us out here. We who plod on bravely, lured by the pleasure in blogging, and subject to its woes.

1 March 2010 11:50 Rafay Baloch said...

Hi amanda i want to have a link exchange with your site
Make money online

5 March 2010 10:36 bdlinkpoint said...

http://digitalblog24.blogspot.com/2010/03/we-know-that-blogger-has-supported.html

14 March 2010 17:08 g2 said...

thnxx a lot..it helped me a lot otherwise direct image hosting was affecting my page rank, as it affected...but now i guess it won't affect anymore because i learned now how to jump the page..thnxx

15 March 2010 13:46 Tia Fisher said...

Hi

I have the same problem as sundowndos and Adam @ Low Tech Combat on my blogger.com blog ... I can insert the jump break fine, but (even though the layout says 'read more' in blog post widget), the 'read more' text doesn't appear on the published, truncated post. I haven't previously used a 'read more' hack, so I don't think there is a conflict with the html. Can anyone help?

Thanks very much in advance

27 March 2010 01:56 G said...

Its Work Perfectly....Thank You So Much

26 April 2010 12:00 Elvie said...

Thank you! I've been looking for this. Will do it now.

28 May 2010 00:59 Tech Tips said...

Wow..Finally I done it .thanks to your wonderful tweak on blogger.Before I found your blog I was thinking to change my template due to the lack of some customization ability.Now I made it with your help.

thanks a lot

With regards | Raso

29 May 2010 03:57 KlusTTer said...

i can't find any of the phrase in my blog

can you help?

1 June 2010 05:27 Traveler said...

Hi Amanda,

thanks for the tricks. my question is: how can I align the read more text with the post body? it's a bit annoying to see the read more link a bit too left...

my blog is hijaufavoritku.blopspot.com

9 June 2010 13:37 eVivz said...

hey its not working with my present template...

at eyuva.com

can u help me?

i did as u said..

Post a Comment

Browse through the Archives

All existing posts are still available to view while I'm working on the site, albeit seen in a much simpler interface. Feel free to browse through the archives to find tutorials, templates and articles to help you build a better blog:

Blog Archive

© Blogger Buster 2010 Home | About | Contact | Hire Me