In this article am gonna tell "How to create [Return to top] links on all post?" Its a simple work with template editing.
- Follow First two steps as previous article.
- Find the following codes one by one and place the code <a name='posttop'/> before each code given below.
- <a expr:href='data:post.link'><data:post.title/></a>
- <a expr:href='data:post.url'><data:post.title/></a>
- <data:post.title/>
- <data:post.title/>
- You shall see the above codes some where around the code <b:includable id='post' var='post'> and the above part of code looks like as below.
<b:if cond='data:post.title'>
<h3 class='post-title entry-title'> <b:if cond='data:post.link'> <a expr:href='data:post.link'><data:post.title/></a> <b:else/> <b:if cond='data:post.url'> <b:if cond='data:blog.url != data:post.url'> <a expr:href='data:post.url'><data:post.title/></a> <b:else/> <data:post.title/> </b:if> <b:else/> <data:post.title/> </b:if> </b:if> </h3> </b:if> |
---|
- After doing steps 1 & 2, Your code will look like as shown below.
<b:if cond='data:post.title'>
<h3 class='post-title entry-title'> <b:if cond='data:post.link'> <a name='posttop'/><a expr:href='data:post.link'><data:post.title/></a> <b:else/> <b:if cond='data:post.url'> <b:if cond='data:blog.url != data:post.url'> <a name='posttop'/><a expr:href='data:post.url'><data:post.title/></a> <b:else/> <a name='posttop'/><data:post.title/> </b:if> <b:else/> <a name='posttop'/><data:post.title/> </b:if> </b:if> </h3> </b:if> |
---|
- Now find <b:if cond='data:post.hasJumpLink'> and the code around will look as below,
<b:if cond='data:post.hasJumpLink'>
<div class='jump-link'>
<a expr:href='data:post.url + "#more"' expr:title='data:post.title'><data:post.jumpText/></a>
</div>
</b:if>
|
---|
- Replace the above lines of code in red with the following lines of code in blue.
<b:if cond='data:post.hasJumpLink'> <div class='jump-link'> <a expr:href='data:post.url + "#more"' expr:title='data:post.title'><data:post.jumpText/></a> </div> <b:else/> <a expr:href='data:post.url + "#posttop"'>[Return to top]</a> </b:if> |
---|
- Save template. You are done with it!
- It is found that your site is more visible in SEs when links of your own blog is given a number of times inside your site itself. So implementing this is recommended.
- To know how I controlled the flow of code above with vertical scroll bars, click here.
- Still an easy method. Go to HTML Template editor.
- Find <data:post.body/> or sometimes <p><data:post.body/></p>. However You could find <data:post.body/> using Ctrl + F.
- Replace either with the following code,
<b:if cond='data:post.hasJumpLink'><data:post.body/><b:else/><a name='postbody'/><data:post.body/><a href='#postbody'><font size='5'><div align='right'>▲</div></font></a></b:if> - Save Template.
Comments
Post a Comment