Search blog

Saturday, October 18, 2008

Show Only Post Excerpt In The Home Page

Instead of displaying the whole post in the homepage you can simple display, only some excerpts from your article; and write 'Read more...,' instead. In this way when they click 'Read More' the complete article will be displayed. It gives a professional look to your page.

Login to your account and click on the “Layout” tab. Then select “Edit HTML”. Check ” Expand Widget Templates”.
Now search for </b:skin> and paste the below code between </b:skin> and </head>




<!-- Style to implement "Read more.." link in all the posts (Start) -->
<style>
    <b :if cond='data:blog.pageType == "item"'>
        span.fullpost {display:inline;}
    <b :else/>
        span.fullpost {display:none;}
    </b></style>
<!-- Style to implement "Read more.." link in all the posts (End) -->

Now search for <data:post.body/> in the template HTML and paste the following piece of code after <data:post.body/>



<!-- Code to show "Read more.." Link (Begin) -->
          <b :if cond='data:blog.pageType != "item"'>
              <span>
                <a expr:href='data:post.url' 
style='color:#0000FF; 
text-align:right;
font-weight:bold; 
text-decoration:none'>
Read more..</a>
             </span>
          </b>
          <!-- Code to show "Read more.." Link (End) -->

Save it. That’s all about coding part of the theme. To show only post excerpts on the homepage, you need to insert <span class="fullpost"> post excerpt.Remaining article will be shown after clicking on "Read more.." link.</span> . Now your articles and blog will look more professional.

No comments:

Post a Comment

Thank you for your Feedback!
www.evagabond.me

Top 5 Posts (Weekly)