Home page excerpts in blogger

by Sriraj on January 14, 2009

Home page excerpts gives your audience a brief view about a bunch of your posts at once and if they are  interested in any of them, they’ll click on that post link to read the full entry.

Note that excerpts will only show when visitors view the home page or archived page. Now to do this you have to enable post pages first (Go to settings–>archiving and enable post pages).

You need to add three bits of code here to get through the process. I’m assuming that you have the latest template type blog and not the classic template blog.

Go to layout and click on edit HTML.

Add the following code in your template style sheet. That is in between the <style> </style> tags. If you do not find the style tags just add it below the opening <head> tag.

<b:if cond=’data:blog.pageType == “item”‘>

   span.fullpost {display:inline;}

<b:else/>

   span.fullpost {display:none;}

</b:if>

Then search for <data:post.body/> tag.(Use ctrl+f to make your search easy).

Add the following code after that  <data:post.body/> tag.

<b:if cond=’data:blog.pageType != “item”‘><br />

   <a expr:href=’data:post.url’>Read the rest of the entry</a>

</b:if>

The changes in your template are done. Now you have to add a small bit of code to every post that you want to show as a excerpt.

Add <span class=”fullpost”></span> to every post in HTML mode.

You need to add it to every post should you want every post to show only an excerpt in your Home page and archive page. There is no cut out for this.

Anyway, this is Blogger and not WordPress right?

Visitors who read this article also read:

  1. Excluding a particular category posts from home pageIf you’re using wordpress you may sometimes need to keep a particular category away from appearing on your homepage.This situation...
  2. Put ads below your post title in bloggerHaving seen how to swap blog title and post title for a better SEO result now let us see how...
  3. Making a sticky post in BloggerA sticky post is the one that stays at the top of all posts/articles on the Blog’s Homepage. With WordPress...
  4. Swap(exchange) blog title and post title for better SEOIn my previous post i have shown how to make your recent comments appear in your sidebar. Now let us...
  5. WordPress stats plugin now shows home page views tooWhat I noticed today when I went to the site stats section is that the WordPress stats plugin is showing...
  6. Category specific adsense ads for your blogOne problem that majority of bloggers have is that their ads are not relevant to their content. Blogs with multi...

{ 6 comments… read them below or add one }

Roswitha July 31, 2010 at 3:53 am

Hello, i tried to apply this on my blog, but i don’t have any “” in my code, what should i do ?
Thank you.

Reply

Rajeesh January 21, 2010 at 7:34 pm

Hi,

Where should I add the in the post. I am not getting any result. I placed the code at the very start of the post and also tried at many places that I believe could be the position.

Can u please tell the exact position where the code is to be placed.

Thanks
Rajeesh

Reply

hokya August 31, 2009 at 11:21 pm

it still consume bandwith, could blogger possibly accept substr PHP code ?

Reply

Naveed June 8, 2009 at 2:00 am

Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: Open quote is expected for attribute “{1}” associated with an element type “cond”.

this error occurs when i do so…

Reply

sriraj June 8, 2009 at 4:54 am

Check if all the opening brackets are properly followed by a closed brackets.
Going by the error, it seems as if some open quote is missing. Quote’s are nothing but ” “.
See if this solves the issue.

Reply

Ryan Grange January 29, 2009 at 4:20 am

The problem with this hack is that the data is still sent to the browser. It isn’t displayed, but it still eats bandwidth and slows down page rendering.

Reply

Leave a Comment

Copyright © 2008-10.Sriraj Digital Magazine.