Skip to main content

How to create [Return to top] links on all post?

In this article am gonna tell "How to create [Return to top] links on all post?" Its a simple work with template editing.
  1. Follow First two steps as previous article.
  2. 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/>
  1. 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.
  2. <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>
  1. After doing steps 1 & 2, Your code will look like as shown below.
  2. <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>
  1. Now find <b:if cond='data:post.hasJumpLink'> and the code around will look as below,
  2. <b:if cond='data:post.hasJumpLink'>
    <div class='jump-link'>
    <a expr:href='data:post.url + &quot;#more&quot;' expr:title='data:post.title'><data:post.jumpText/></a>
    </div>
    </b:if>
  1. Replace the above lines of code in red with the following lines of code in blue.
  2. <b:if cond='data:post.hasJumpLink'>
    <div class='jump-link'>
    <a expr:href='data:post.url + &quot;#more&quot;' expr:title='data:post.title'><data:post.jumpText/></a>
    </div>
    <b:else/>
    <a expr:href='data:post.url + &quot;#posttop&quot;'>[Return to top]</a>
    </b:if>
  1. Save template. You are done with it!
  2. 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.
  3. To know how I controlled the flow of code above with vertical scroll bars, click here
Update :-
  1. Still an easy method. Go to HTML Template editor.
  2. Find <data:post.body/> or sometimes <p><data:post.body/></p>. However You could find <data:post.body/> using Ctrl + F.
  3. 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'>&#9650;</div></font></a></b:if>
  4. Save Template.
Happy Blogging!
See related posts:

Comments

People also read,

How to secure your Google account and Blogger blog?

As a part of contributions to NCSAM, I am writing this article down on what all should we be aware of with respect to Google's security aspect and how to make sure your blog stays yours forever. What is NCSAM? It's National Cyber Security Awareness Month which is observed during the month of October every year in America. However, we all know cyber security is a world topic and is not limited to just the USA. So let me give some tips with respect to keeping the Google account safe and Blogger blogs safe from hackers. As I secure my account, I hope you people catch up too. In this blog post, I am going to tell about the following, Securing your Google account. Securing your Blogger blog. Securing your Google account Since Blogger is also part of your Google account, let's first see what all we need to do to keep our Google account safe. Don't share your password to anyone. Keep changing your password every 60 - 90 days. Make sure your password is str...

Blogger Tweak - Open external links in new tab automatically

So, once upon a time, a really long while ago, I tried to customise and recreate a Blogger template which is not available anymore, but there's one thing I remember about it. I had a jQuery code written to make all the external links open in new tab. I also thought, it's about time I revive that idea and write a more intact code and here we go.  So, there are two things to do.  Add Javascript code that detects external links and opens them in new tab. Add a CSS code to let users know that a particular link is going to be opened in new tab. Adding a javascript code Please follow the instructions below, Go to https://blogger.com  dashboard Navigate to Themes > click the down arrow near "Customize" and then click on Edit HTML. Now scroll to the very end and paste the following code just before </body> tag. <script type='text/javascript'> document.body.addEventListener(&quot;mousedown&quot;,function(event){       if(event.target.ta...

Blogger & Twitter card previews

 So, there was a report in Blogger Help Community which is what made me write this down.  This is in correlation with Blogger & Facebook OG Object debugger . The report was that Blogger blogs doesn't show preview in Twitter card validator . So, I went ahead and tried previewing one of my blog posts and I got the following, Therefore, I tweeted the same link which is here and it didn't show any preview.  Hence, I concluded not just the validator, the whole twitter stopped scraping my open graph information. Therefore, I made a small research and added a tag in my template. Please follow instructions below, Go to  https://blogger.com  > Themes Click on the three dot menu near "My Themes" and choose Edit HTML In the appearing page, press Ctrl + F and find the below code, <b:include data='blog' name='all-head-content'/> Right after that code, paste the following code, <meta name="twitter:card" content="summ...