Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to create a blogger template for my own educational purpose. I need to show a specific lines from a post as a post summary in blogger. I tried two methods one of them is by the code given below, but problem is those scripts just shows the first n characters as a post summary but I need a particular content present in-between the paragraph as a post summary.
JavaScript
<b:if cond='data:blog.pageType != "item"'>     
    <img expr:src='data:post.thumbnailUrl'/><br/>
        <data:post.snippet/>
      </b:if>

The next method, I use individual search description for my post. so I decided to print the search description as my post summary and use this code
JavaScript
<b:if cond='data:blog.pageType != "item"'>     
        <img expr:src='data:post.thumbnailUrl'/><br/>
            <data:blog.metaDescription/>
          </b:if>

but again those code only print the description of the blog not the post. So is there any other way to show the specific line as a post summary.

What I have tried:

Method:1
JavaScript
<b:if cond='data:blog.pageType != "item"'>     
    <img expr:src='data:post.thumbnailUrl'/><br/>
        <data:post.snippet/>
      </b:if>


Method:2
JavaScript
<b:if cond='data:blog.pageType != "item"'>     
        <img expr:src='data:post.thumbnailUrl'/><br/>
            <data:blog.metaDescription/>
          </b:if>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900