3/15/09

how to add "read more" tag to blogger




All these days, i searched and searched for an article on how to add the "continue reading" tag for a blogger post, and eventually my search ended up in an article called "how to get extremely pissed off when something doesn't happen the way you want it to." Sounds pretty familiar???

I seriously think you are correct because, firstly there are a few sites which offer you the tip on how to add the "read more" tag and all of them didn't work properly (at least for me, they didn't). When I followed their procedure, I ended up getting error messages like the following:
  • Your template could not be parsed as it is not well-formed. Make sure the 'div' tags is ended with a proper end tag.
  • or make sure the b:if tag is ended with a proper 'end' tag.
If these are the error messages you encountered or anything which sounds unfamiliar to you, just follow this small tutorial and it will be easy as sipping coffee!!

There are only two steps involved in getting a "read more" tag. It couldn't be more simpler than this.
  • Go to your blogger dashboard by logging in and browse to 'Layout>Edit HTML' and then you will be presented with the HTML/CSS code for the template your blogspot adores itself with. You might want to copy the whole code and paste it in notepad(preferably Notepad++) and then modify it there and then later paste the whole thing back in the Blogger pad.
  • Then, search for this part of the code (by pressing Ctrl + F):
I found out that some of the xml templates doesn't have the same code structure to what i have explained above and this could pose a lot of problems to bloggers who are searching hard to find the above mentioned code lines. So after reviewing one of my peer's blog, i found at another way to rectify this "more tag" problem. Here is how you do it.

Find this part of the code in the xml template:
<data:post.body/>
Once you find this code, "REPLACE" the above line with the following set of lines:

<b:if cond='data:blog.pageType == "item"'>
<style>.fullpost{display:inline;}</style>
<data:post.body/>
<b:else/>
<style>.fullpost{display:none;}</style>
<data:post.body/>
<a expr:href='data:post.url'>Continue Reading »</a>
</b:if>
Now, Save the template and go to Settings>>Formatting and scroll below till you find the Post Template window and in the given space, paste the following lines:

<span class="fullpost">

</span>


Save the settings and when you create a new post, you can observe(html section) that the following code is automatically generated:

<span class="fullpost">
</span>
If you want you add the "more tag to you existing posts, just go to "edit HTML" and paste the part of the article you want to be visible when the read more tag is clicked, between these two lines:

<span class="fullpost">

The part of the post invisible in the main page comes here.....

</span>
Thats about it. If you have any problems with understanding the above code or if you get any sort of errors, please feel free to comment and i shall try my best to rectify it.

Reblog this post [with Zemanta]

19 comments:

Anonymous said...

This is the best tutorial on adding a read more tag. My quest finally ends here. Keep up the good work.

Anonymous said...

did u use simplebits to display the html code in ur post or wat?

Richie said...

yep....i already posted an article on that

Anonymous said...

this is a killer post. god knows how much i searched for this tutorial. quite satisfied now.

Joe E. Holman said...

THis didn't work for me, pal. Guess I'll have to look for another. Still, it's a very good tutorial.

(JH)

admin said...

what is the error that u are getting?

aknemesist said...

thank so much for this tutorial!

Anonymous said...

Aww, this did not work for me, too. I did go to Layout>Edit HTML, then pasted the whole code stuff in my text editor. I tried looking for "data:post.body" but it said "Not Found." Does it work for specific templates only? Thanks.

-J-

Rich said...

well... most of the templates have this code, but there are a few exceptions as well.... there are quite a lot of other sites which describe about other methods, which i suggest u try. But if u ever change ur theme, make sure u come back to this site.. thanx

GRE Verbal- ASPIRE TO SCORE 800 said...

Damn man this dint work for me. I searched many sites all are just not convincing. search in on

David Lee said...

its only working when i post a "new post" but for existing posts i cant add the code correctly for some reason???

Rich said...

U can do it for the previous posts as well. just go to Edit post>Edit HTML and paste the span fullpost open and close tag just as indicated. It should work just fine. I have described it in the last section of the article :D ...

Chandraas said...

dear sir,

Getting more taga it is very simple from ur tutorials.

thankyou,
chandraas

Richie said...

@malli... good... i'm glad it worked.. keep visiting...

http://news.techtricks.co.in

dave said...

bummer, not working for me either.


Outside Pro

Self Sagacity said...

I was really hoping I could figure out how to make my work with your instructions, but it didn't. From previous tries, I've left unwanted codes and now I don't know what to take out. It's frustrating, I've tried so many instructions, it's me, I know. I hope you can help, I can't paste the code here, your page won't let me.

Self Sagacity said...

Never mind...This is so hot! It worked. I took out all the previous codes, while praying not to screw up, and it worked! Thanks so much, whether or not it was all your credit, the fact remains, I stop my frustration at this site. WooHoo!

A2ZeK said...

my blogger template not have this tag plzz plzz plzz help me what can i do......i want to add more tag in my blog.

Vandana said...

ah was looking for this, I hope it works for me. Thanks

Post a Comment

Do you have any suggestions? Leave them here and help me enhance my blog. Please don't spam (^_^)

Blogumulus by Roy Tanck and Amanda Fazani
Spreadfirefox Affiliate Button
Creative Commons License
 

Nerd 2 Geek | Copyright 2009 Richie Thimmaiah | Blogger Template by GoogleBoy ve anakafa | Sponsored by Noow!