How To Display Post Excerpts in Blogger

  • Sharebar

Update:

On September 9, 2009 Blogger introduced “Jump Links” that incorporates the <-- more --> tag, much like WordPress. This allows Blogger users to display posts excerpts easily in their blog. For more information, please read the help article on creating Creating ‘After the jump’ summaries.

Many blogs may display only a few paragraphs of a post, and then provide a link to the rest of the post. These blogs usually publish rather large posts, and would like to display several posts on they home page, without the page getting too large.

WordPress has a tag that you can insert to create a post excerpt, but Blogger doesn’t have such a feature. In this post I will explain a work around you can use to create post excerpts in Blogger.

Create a Post Excerpt

blogger logo 370x368 300x298 How To Display Post Excerpts in Blogger
The method that I will explain below is not one I created. I found it while looking through the Blogger help. Since it can be difficult to find specific help, I have decided to publish the technique in this post.

The technique involves using CSS to hide or display the post. To create a post excerpt in Blogger, use the following steps:

  1. Log in to your Blogger account.
  2. From the dashboard, click the Layout link to the blog you want to add a blogroll to.
  3. In the menu at the top, click Edit HTML to view the HTML for your template.
  4. In the head section of your template, include the following HTML snippet:
    <style>
    <b:if cond=’data:blog.pageType == “item”‘>
    span.fullpost {display:inline;}
    <b:else/>
    span.fullpost {display:none;}
    </b:if>
    </style>

    The above HTML snippet checks to see what page type is currently displayed, and builds the CSS depending on the page type. If the page type is item (or post), then the span tag with the class of “fullpost” is displayed. Otherwise, the span tag is hidden.

    You will see where the span tag is inserted in a little bit.

  5. Search your template for data:post.body. Below that line, add the following:
    <b:if cond=’data:blog.pageType != “item”‘>
    <p><a expr:href=’data:post.url’>Read more!</a></p>
    </b:if>

    The above code will add a “Read more!” link to your post exceprt that will redirect your visitor to your post. You can change “Read more!” to whatever text you like.

  6. Once you have made the above changes, click the Posting tab, and create a new post.
  7. When you are finished writing your post, move your cursor to the end of your post excerpt and insert the following:
    <span class=”fullpost”>
  8. Move to the end of your post and insert the following HTML:
    </span>
  9. This will make your post look like the following:

    This is the first paragraph of the post, and appears as the excerpt.
    <span class=”fullpost”>
    This paragraph will only appear when a visitor clicks on the link to view the entire post.
    </span>
  10. Save your post, and then view it in a browser. You should now see your post excerpt, and your link, on your home page. Clicking the link should take you to your post.

The one downside to using this method is that the visitor will still download the entire post as the displaying of the post is controlled by CSS. This method, however, will allow you to display excerpts from each post, without the display of your page being too large.

When I used Blogger, I used this technique on my blog since I do write fairly large posts, but since I switched to WordPress, I use WordPress’ built-in method.

Tags: ,

You may also like:

Blogger Logo

How to Display Recent Post Titles in Blogger

Blogger Logo

How To Easily Display a Blogroll on Blogger

Blogger Logo

Display a Blog List as a Static Page in Blogger

Blogger Logo

A List of Common Tags in a Blogger Blog Post Header

25 people had something to say about “How To Display Post Excerpts in Blogger”:

Comments


  1. Great info! I prefer to use the wordpress build in “read more!” or whatever it say. It’s also much easier to cut the post by just adding and viola.

    Thanks


  2. It’s showing an error i.e “LHS of numeric is null before 28 in data:blog.pageType == “item” .
    Any idea how to overcome that.
    Thanks
    Mohit


    • Ensure you have included all the necessay single and double-quotes in the code. You may need to retype the single-quotes if you copied the code into your template. There have been problems with the single-quotes in the past.

      With regards to the error, I haven’t seen that one before. I would need to see the entire line in question to determine what the problem is.


  3. What does one do if there’s no data:post.body in the HTML code?


    • make sure the check box on ‘expand widgets’ is checked.


  4. 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”.

    It shows this error please help…………


    • I had the same issue as you. I had to remove the tags and put the code right before the closing tag of the template skin. So it looked like this:


      span.fullpost {display:inline;}

      span.fullpost {display:none;}

      ]]>


      • Well, it stripped the code. Maybe this will work?



        span.fullpost {display:inline;}

        span.fullpost {display:none;}

        ]]>


  5. Any idea how to do this on a classic blogger template?


  6. great info! try this one to my blogger…
    Cheap Android recently posted…LG Optimus GT540 – Middle Range SmartphoneMy Profile


  7. Perfect! This is what I am looking for, since most of my posts are very long and I need to have the excerpt posted instead…
    UnwiredTech recently posted…CSS Optimizer – clean your codesMy Profile


  8. The homepage looks good if only the post excerpts are showing. Thanks for sharing this tutorial.


    • Hi Raymund. No problem. I like a blog’s homepage that shows only excerpts. It allows more posts to be displayed without increasing the size of the page.


  9. Nice post. very helpful for me. I was searching for this since long. finally my search ends on this blog.
    Dheeraj recently posted…Angry Bird game for PC Download for FreeMy Profile


  10. Hi… I could not get the data:blog.body tag

    and I also got an error showing “LHS of numeric is null before 28 in data:blog.pageType == “item”

    Please help. Thanks..


  11. Hi… I re-did it again, the template saved but when I viewed my blogger page, it think it stripped the code.. Please help.


    • Stripped the code? Do you mean that the code wasn’t saved with the template?


  12. I was saved but when I viewed my blog, all my post was not displayed, leaving only widgets on the page… But it’s ok… I found out the ‘jump’ feature on Blogger.
    Thanks anyway…


  13. Good trick bro! Thanks for share.
    Latest News recently posted…Drake Puts Rick Ross in the Class of Biggie and Snoop DoggMy Profile


  14. Thanks for share this bro :D
    It still can be used


  15. good trick, it still works!
    ravi recently posted…Best Android Tablets in India- October 2011My Profile
    Twitter:


  16. I have already written about 220 blogposts and I now want to display an excerpt in every post.

    How can I do this without being forced to change all of them ? This will take a little while……
    Rasmus recently posted…2 olika webbtjänster som erbjuder dig möjligheten att börja tjäna pengar på TwitterMy Profile


    • I believe Blogger’s new way of displaying excerpts requires you to modify the posts, but I could be wrong. You will need to perform a search on Blogger as to the best way of displaying excerpts as Blogger has changed since this post was written.


  17. Thanks for the info! This is just what I needed! If you have time please check out my blog on How To: Root DroidX2 DroidX Droid2 I’d appreciate it!
    Josh recently posted…30 Days Of Droid – A new winner EVERY DAY for 30 Days in DecemberMy Profile
    Twitter:

Do you have something to say? Let everyone know!

Commenting policy: All comments are moderated for spam. You must use your real name and not your website name or keywords. If a comment is deemed to be spam, then it will be deleted or edited. Links to your website within the comment body is not permitted, but you are free to use CommentLuv to add a link to your latest post. If you wish to add a link to your website, you can always contact me about submitting a guest post.






CommentLuv badge
This blog uses premium CommentLuv which allows you to put your keywords with your name if you have had 5 approved comments. Use your real name and then @ your keywords (maximum of 3)

Previous Post:

Next Post: