Adding Home Older Newer Post Buttons in new Blogger templates such as Contempo

Requirement: Add Home, Older, Newer Post Buttons in new Blogger templates such as Contempo.

Solution:
Hi for this jump to Blog widget in HTML editor of your template and find and replace code in includables with respective id's with the ones given below also change the order of buttons as shown below in postPagination includable as per your needs.

Code given below shows button in this order  Older Posts Home Newer Posts
Demo: Can be seen by clicking here and scrolling to end of page.
Screenshot:


Note: First page will display only Older posts button as there is nothing to go back when we are on landing or home page and the last page will display Previous posts button and the Home button as there is nothing left to go forward.

Displays buttons in order provided here in frontend ,ID to search postPagination:

<b:includable id='postPagination'>
  <div class='blog-pager container' id='blog-pager'>
    <b:include cond='data:newerPageUrl' name='previousPageLink'/>
    <b:include cond='data:view.url != data:blog.homepageUrl' name='homePageLink'/>
    <b:include cond='data:olderPageUrl' name='nextPageLink'/>
  </div>
</b:includable>

Displays Home button ,ID to search homePageLink:

<b:includable id='homePageLink'>
<b:comment>Don&#39;t show</b:comment>
<a class='home-link flat-button ripple' expr:href='data:blog.homepageUrl' style='margin:0px;'>Home</a>
</b:includable>

Displays Older Post button ,ID to search nextPageLink:

<b:includable id='nextPageLink'>
          <!--<a class='blog-pager-older-link flat-button ripple' expr:href='data:olderPageUrl' expr:title='data:messages.morePosts'>
            <data:messages.morePosts/>
          </a>-->
<a class='blog-pager-older-link flat-button ripple' expr:href='data:olderPageUrl' title='Older Posts'>Older Posts&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;rarr;</a>
        </b:includable>

Displays Newer Post button ,ID to search previousPageLink :

<b:includable id='previousPageLink'>
<b:comment>Don&#39;t show</b:comment>
<a class='blog-pager-newer-link flat-button ripple' expr:href='data:newerPageUrl' expr:id='data:widget.instanceId + &quot;_blog-pager-newer-link&quot;' title='Newer Posts'>&amp;larr;&amp;nbsp;&amp;nbsp;&amp;nbsp;Newer Posts</a>
</b:includable>

Comments

Popular posts from this blog

Adding copy to clipboard button to every google code prettify pre blocks in blogger

Checklist: Before applying for adsense