Saturday, May 25, 2013

Fading Box With Newer/Older Posts Links and Titles for Blogger

The navigation links are those that appear at the bottom of the page that says "Older Posts", "Newer Posts" and "Home" and help us to move through the blog posts. This tutorial will show you how to change the word "Older Posts" and "Newer Posts" for post titles and make these to appear in a box "fading" when you scroll down the page.
blogger gadgets, navigation for blogger

You can see it in action on this demo blog - when you scroll down, the navigation links will appear showing the post titles for the older/newer entries.

This way to display the navigation links will be seen only in individual entries, while those on the homepage and other parts of the blog will still be displayed as usual.

How to Add Navigation Box with Newer & Older Posts on Blogger

Step 1. From your Blogger Dashboard, go to Template > Edit HTML, click anywhere inside the code area and search - using CTRL + F - for this line:

<b:include name='nextprev'/>


Step 2. REPLACE the code above with this one:

<b:if cond='data:blog.pageType != &quot;item&quot;'>
<b:include name='nextprev'/>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div id='blog-pager-box'>
<h4>Other posts published:</h4>
<b:include name='nextprev'/>

Note: you can change the "Other posts published" title with your own

Step 3. Now add just above </head> the following code:

<b:if cond='data:blog.pageType == &quot;item&quot;'>
<script src='' type='text/javascript'/>
// <![CDATA[
$(function() {
width: '520px',
height: '150px',
position: 'fixed',
padding: '1em',
bottom: 0,
right: 0,
background: 'url('

$(window).scroll(function() {
if($(this).scrollTop() > 100) {
} else {
var newerLink = $("").attr("href");
$("").load(newerLink+" .post-title:first", function() {
var newerLinkTitle = $("").text();
$(".blog-pager-newer-link").html("<div>Newer Posts:</div>" + newerLinkTitle);
var olderLink = $("").attr("href");
$("").load(olderLink+" .post-title:first", function() {
var olderLinkTitle = $("").text();
$(".blog-pager-older-link").html("<div>Older Posts:</div>" + olderLinkTitle);
// ]]>

<style type='text/css'>
#blog-pager-box {
box-shadow: 0 0 3px #AEAEAE;

#blog-pager-box h4 {
color:#4898B9; /* Widget's title color */
font-size:16px; /* Title font size */

#blog-pager-newer-link {float:left;clear:both;line-height:30px;}
#blog-pager-older-link {float:left;clear:both;line-height:30px;}
.home-link {display:none;}
.blog-pager-older-link, .blog-pager-newer-link {
background-color: transparent !important;
background-image: none !important;
border:0 !important;
color: #4B4B4B !important; /* Color of the links */
float: left;
width: 500px;
}, {
text-decoration:none !important;
} {
content: url(;
} {
content: url(;
#blog-pager {
background-color: transparent !important;
background-image: none !important;
border:0 !important;
#blog-pager div {
color:#0577AB; /* Color for the "Newer Posts" and "Older Posts" text */
margin-bottom: -5px;
a#blog-pager div:hover {
text-decoration:none !important;
color:#4898B9; /* Color for the "Newer Posts" and "Older Posts" text */

Note that this gadget uses jQuery, so try to have only one version.


- There are three URLs in blue, the first is the paper background image for the box, the other two are the icons that correspond to the arrows. You can replace these with your own.
- In green you can see where to change the text colors.
- The red number is the distance in pixels that activates the gadget, this means that the box will appear when you scroll down the 100px. You can use a higher value if your posts are usually long and therefore the "height" of the scroll is greater.
Step 4. Now, Save the Template and that's it!

You can also change the "Older Posts" and "Newer Posts" links with posts titles or images.

No comments:

Post a Comment

Search This Blog

Recent Post

Recent Posts Widget

Popular Posts