Auto Read More with thumbnail on Blogger Post.


In this tutorial you'll find out how to tweak your blog with none javascript to urge the same impact. On our homepage, all posts can show a brief outline, followed by a "Read More" link. Clicking the "Read More"-link can point out the post page with the total post text.



Step 1: keep a copy your template

Open the Layout|Edit HTML-tab on your Dashboard, associated transfer the model as an XML-file to your harddisk. If something goes wrong, transfer it once more and there'll be no downside in the slightest degree.

Step 2: Modify the template code

Scroll down and appearance for the subsequent piece of code:
<div class='post-body entry-content'>
  <data:post.body/>
  <div style='clear: both;'/> <!-- clear for photos floats -->
</div>

This is the piece of template code that displays the post-body on the screen. We have to add a few lines of code here:

<div class='post-body entry-content'>
  <b:if cond='data:blog.homepageUrl == data:blog.url'>
    <style type='text/css'>.restofpost {display:none;}</style>
  </b:if>
  <data:post.body/>
  <b:if cond='data:post.link'>
    <a expr:href='data:post.link'>Read more...</a>
  <b:else/>
    <b:if cond='data:post.url'>
      <a expr:href='data:post.url'>Read more...</a>
    </b:if>
  </b:if>
  <div style='clear: both;'/> <!-- clear for photos floats -->
</div>

Now save your template.

Step 3: Adjust your post template

In your Blog Settings you can modify the post template. Change it to:
<div class="summary">Type summary here</div>
<div class="restofpost">Type rest of post here</div>

And save your venues.
This will take care of all new posts. Type the summary text in between the summary-div-tags. Type the rest of the post between the other div-tags, and publish!

Step 4: Adjust old posts

If you want older posts to have summaries as well, change every post and add a summary-div and restofpost-div.

In addition, The summary-div is not really necessary, as the code only hides the restofpost-div if we are on the homepage. If you want some other styling for the summary, add CSS-tags to the skin-part of your blog.

Labels: