Content feed Comments Feed

How to create expandable post summaries.

Posted by Wonderful-Tricks
ADVERTISEMENTS

How to create expandable post summaries.

1. Find the

</head>

tag in your template and add all the code from this page before it.

2. Find this div for the post-body and add the portion of code in red color.


<div class='post-body' expr:id='"post-" + data:post.id' >
<b:if cond='data:blog.pageType == "item"'>
<style>#fullpost{display:inline;}</style>
<p><data:post.body/></p>
<b:else/>
<style>#fullpost{display:none;}</style>

<p><data:post.body/></p>
<span id='showlink'>
<a expr:href='data:post.url'>Read More......</a> </span>
<script type='text/javascript'>checkFull("post-" + "<data:post.id/>");
</script>
</b:if>

<div style='clear: both;'/> <!-- clear for photos floats --> </div>




3. Goto Settings->Formatting and at the bottom, you will find the text box provided to specify the "Post template". Copy/paste these lines into that text box and save the settings. (Please DON'T type these lines yourself because you might introduce some spaces that will break the functionality)


Type your summary here
<span id="fullpost">
Type rest of the post here
</span>


If you create a new post now, it shows you clearly where to type the summary and where to add the rest of the post. Please note that you could also divide some or all of your old posts into summary and full post by editing them. The "Read more" link will appear only for the posts that have been divided like this.

Your Ad Here

0 comments

Post a Comment

Blogumulus by Wonderful-Tricks

Followers