Beautiful Numbered Page Navigation for Blogger

CSS and Javascript blogger page navigation widget
You may get thousands of numbered page navigation widget for your blogger blog in Google search. But this is totally different because of its look and professionalism. This widget works in both pure CSS and JavaScript. I hope it will attract your visitors to explore your blog and view page per page and make your blog more professional and beautiful. Now lets get into the tutorial


Before we go to the trick, please take look at the demo image screenshot shown below ▼ of what this is all about (ie, your page navigation widget will look like as below image).



blogger page navigation widget demo


questionmark icon png How to add this widget to your Blogger blog
As I mentioned above I would like to divide the task into two parts. CSS part and JavaScript part. First we have to add the skin of this widgets, that's CSS part. So please follow the below steps carefully.

  • Go to Blogger Dashboard > Template
  • Backup your Template before making any changes to your blog
  • Click on Edit HTML
  • Tick Expand Widget Templates
  • Press Ctrl + F and search the code shown below ▼

]]></b:skin>

Now add the below code just Above/Before ]]></b:skin> (use Ctrl+F to find the code)

.pagenavi{
position: relative;
display: block;
width: 400px;
height: 40px;
overflow: visible;
margin: 50px auto;
border: 10px solid rgba(255,255,255,0.5);
/*border-radius*/
-webkit-border-radius: 40px;
-moz-border-radius: 40px;
border-radius: 40px;
/*box-shadow*/
-webkit-box-shadow: inset 0 0 10px #fff,0 1px 0 #666,0 -1px 0 #fff;
-moz-box-shadow: inset 0 0 10px #fff,0 1px 0 #666,0 -1px 0 #fff;
box-shadow: inset 0 0 10px #fff,0 1px 0 #666,0 -1px 0 #fff;
}
.pagenavi span,.pagenavi a{
font: bold 20px/30px Tahoma, Arial;
cursor: pointer;
text-decoration: none;
color: #464646;
display: block;
float: left;
margin-left: 2px;
/*box-shadow*/
-webkit-box-shadow: inset rgba(0,0,0,0.1) 0 1px 0, inset rgba(255,255,255,0.7) 0 2px 0, inset rgba(255,255,255,0.7) 0 -1px 0, inset rgba(255,255,255,0.7) 1px 0 0, inset rgba(255,255,255,0.7) -1px 0 0, rgba(0,0,0,0.3) 0 3px 0;
-moz-box-shadow: inset rgba(0,0,0,0.1) 0 1px 0, inset rgba(255,255,255,0.7) 0 2px 0, inset rgba(255,255,255,0.7) 0 -1px 0, inset rgba(255,255,255,0.7) 1px 0 0, inset rgba(255,255,255,0.7) -1px 0 0, rgba(0,0,0,0.3) 0 3px 0;
box-shadow: inset rgba(0,0,0,0.1) 0 1px 0, inset rgba(255,255,255,0.7) 0 2px 0, inset rgba(255,255,255,0.7) 0 -1px 0, inset rgba(255,255,255,0.7) 1px 0 0, inset rgba(255,255,255,0.7) -1px 0 0, rgba(0,0,0,0.3) 0 3px 0;
padding: 2px 10px;
min-width: 10px;
text-align: center;
position: relative;
text-shadow: #fff 0 1px 0;
background: #cdcdcd;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(255,255,255,0.8)), to(rgba(200,200,200,0.9)));
/*linear-gradient*/
background: -webkit-gradient(linear,left top,left bottom,from(rgba(255,255,255,0.8)),to(rgba(200,200,200,0.9)));
background: -webkit-linear-gradient(top, rgba(255,255,255,0.8), rgba(200,200,200,0.9));
background: -moz-linear-gradient(top, rgba(255,255,255,0.8), rgba(200,200,200,0.9));
background: -o-linear-gradient(top, rgba(255,255,255,0.8), rgba(200,200,200,0.9));
background: linear-gradient(top, rgba(255,255,255,0.8), rgba(200,200,200,0.9));
}
.pagenavi a:after {
content: '';
position: absolute;
bottom: -3px;
height: 100%;
display: block;
width: 100%;
left: 0;
/*box-shadow*/
-webkit-box-shadow: inset rgba(255,255,255,0.2) 1px 0 0, inset rgba(255,255,255,0.2) -1px 0 0, rgba(0,0,0,0.4) 0 1px 0;
-moz-box-shadow: inset rgba(255,255,255,0.2) 1px 0 0, inset rgba(255,255,255,0.2) -1px 0 0, rgba(0,0,0,0.4) 0 1px 0;
box-shadow: inset rgba(255,255,255,0.2) 1px 0 0, inset rgba(255,255,255,0.2) -1px 0 0, rgba(0,0,0,0.4) 0 1px 0;
}
.pagenavi a:first-child::after {
/*border-radius*/
-webkit-border-radius: 500px 0 0 500px;
-moz-border-radius: 500px 0 0 500px;
border-radius: 500px 0 0 500px;
}
.pagenavi a:last-child::after {
/*border-radius*/
-webkit-border-radius: 0 50px 50px 0;
-moz-border-radius: 0 50px 50px 0;
border-radius: 0 50px 50px 0;
}
.pagenavi a.current:after {
height: 1px;
bottom: -1px;
}
.pagenavi a:before {
content: '';
position: absolute;
top: 1px;
height: 100%;
/*box-shadow*/
-webkit-box-shadow: rgba(0,0,0,0.4) 0 3px 0;
-moz-box-shadow: rgba(0,0,0,0.4) 0 3px 0;
box-shadow: rgba(0,0,0,0.4) 0 3px 0;
width: 1px;
display: block;
background: rgba(0,0,0,0.4);
right: -1px;
}
.pagenavi a:last-child::before { display: none !important }
.pagenavi a:first-child {
/*border-radius*/
-webkit-border-radius: 50px 0 0 50px;
-moz-border-radius: 50px 0 0 50px;
border-radius: 50px 0 0 50px;
font-family: 'WebSymbolsRegular';
}
.pagenavi a:last-child {
/*border-radius*/
-webkit-border-radius: 0 50px 50px 0;
-moz-border-radius: 0 50px 50px 0;
border-radius: 0 50px 50px 0;
font-family: 'WebSymbolsRegular';
}
.pagenavi a:hover {
/*box-shadow*/
-webkit-box-shadow: inset rgba(0,0,0,0.1) 0 1px 0, inset rgba(255,255,255,0.7) 0 2px 0, inset rgba(255,255,255,0.7) 0 -1px 0, inset rgba(255,255,255,0.7) 1px 0 0, inset rgba(255,255,255,0.7) -1px 0 0, inset rgba(255,255,255,1) 0 0 15px, rgba(0,0,0,0.2) 0 3px 0;
-moz-box-shadow: inset rgba(0,0,0,0.1) 0 1px 0, inset rgba(255,255,255,0.7) 0 2px 0, inset rgba(255,255,255,0.7) 0 -1px 0, inset rgba(255,255,255,0.7) 1px 0 0, inset rgba(255,255,255,0.7) -1px 0 0, inset rgba(255,255,255,1) 0 0 15px, rgba(0,0,0,0.2) 0 3px 0;
box-shadow: inset rgba(0,0,0,0.1) 0 1px 0, inset rgba(255,255,255,0.7) 0 2px 0, inset rgba(255,255,255,0.7) 0 -1px 0, inset rgba(255,255,255,0.7) 1px 0 0, inset rgba(255,255,255,0.7) -1px 0 0, inset rgba(255,255,255,1) 0 0 15px, rgba(0,0,0,0.2) 0 3px 0;
}
.pagenavi a:active {
/*box-shadow*/
-webkit-box-shadow: inset rgba(0,0,0,0.1) 0 1px 0, inset rgba(0,0,0,0.2) 1px 0 0px, inset rgba(0,0,0,0.2) -1px 0 0px, inset rgba(255,255,255,0.7) 0 2px 0, inset rgba(255,255,255,0.7) 0 -1px 0, inset rgba(0,0,0,0.1) 0 0 15px, rgba(0,0,0,0.2) 0 2px 0;
-moz-box-shadow: inset rgba(0,0,0,0.1) 0 1px 0, inset rgba(0,0,0,0.2) 1px 0 0px, inset rgba(0,0,0,0.2) -1px 0 0px, inset rgba(255,255,255,0.7) 0 2px 0, inset rgba(255,255,255,0.7) 0 -1px 0, inset rgba(0,0,0,0.1) 0 0 15px, rgba(0,0,0,0.2) 0 2px 0;
box-shadow: inset rgba(0,0,0,0.1) 0 1px 0, inset rgba(0,0,0,0.2) 1px 0 0px, inset rgba(0,0,0,0.2) -1px 0 0px, inset rgba(255,255,255,0.7) 0 2px 0, inset rgba(255,255,255,0.7) 0 -1px 0, inset rgba(0,0,0,0.1) 0 0 15px, rgba(0,0,0,0.2) 0 2px 0;
top: 1px;
text-shadow: #fff 0 0 15px;
}
.pagenavi a:active:after { bottom: -2px }
.pagenavi a:active:before {
/*box-shadow*/
-webkit-box-shadow: rgba(0,0,0,0.4) 0 3px 0;
-moz-box-shadow: rgba(0,0,0,0.4) 0 3px 0;
box-shadow: rgba(0,0,0,0.4) 0 3px 0;
top: 0px;
}
.pagenavi a.current {
/*box-shadow*/
-webkit-box-shadow: inset rgba(0,0,0,0.1) 0 1px 0, inset rgba(0,0,0,0.3) 1px 0 0px, inset rgba(0,0,0,0.3) -1px 0 0px, inset rgba(255,255,255,0.7) 0 2px 0, inset rgba(255,255,255,0.7) 0 -1px 0, inset rgba(0,0,0,0.1) 0 0 15px, rgba(0,0,0,0.3) 0 1px 0;
-moz-box-shadow: inset rgba(0,0,0,0.1) 0 1px 0, inset rgba(0,0,0,0.3) 1px 0 0px, inset rgba(0,0,0,0.3) -1px 0 0px, inset rgba(255,255,255,0.7) 0 2px 0, inset rgba(255,255,255,0.7) 0 -1px 0, inset rgba(0,0,0,0.1) 0 0 15px, rgba(0,0,0,0.3) 0 1px 0;
box-shadow: inset rgba(0,0,0,0.1) 0 1px 0, inset rgba(0,0,0,0.3) 1px 0 0px, inset rgba(0,0,0,0.3) -1px 0 0px, inset rgba(255,255,255,0.7) 0 2px 0, inset rgba(255,255,255,0.7) 0 -1px 0, inset rgba(0,0,0,0.1) 0 0 15px, rgba(0,0,0,0.3) 0 1px 0;
top: 2px;
text-shadow: #fff 0 0 15px;
}
.pagenavi a.current:before {
/*box-shadow*/
-webkit-box-shadow: rgba(0,0,0,0.4) 0 3px 0;
-moz-box-shadow: rgba(0,0,0,0.4) 0 3px 0;
box-shadow: rgba(0,0,0,0.4) 0 3px 0;
top: -1px;
}
.pagenavi a.current:active:after { bottom: -1px }

Now we have added the skin of numbered page navigation. Now lets add the JavaScript part. Please search for the below code in your blogger template (use Ctrl+F to find the below code).

<b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'>

Please paste the below code just below/after above ▲ code.

<b:includable id='page-navi'>
<div class="pagenavi">
<script type="text/javascript">
var pageNaviConf = {
perPage: 5,
numPages: 6,
firstText: "First",
lastText: "Last",
nextText: &quot;&#187;&quot;,
prevText: &quot;&#171;&quot; }
</script>
<script type="text/javascript" src="http://rilwis.googlecode.com/svn/trunk/blogger/pagenavi.min.js"></script>
<div class="clear" />
</div>
</b:includable>

Now also find the below code ▼ in your template

<!– navigation –>
<b:include name='nextprev'/>

And replace the above code ▲ with the below code ▼

<b:if cond='data:blog.pageType == "index"'>
<b:include name='page-navi' />
<b:else/>
<b:if cond='data:blog.pageType == "archive"'>
<b:include name='page-navi' />
</b:if>
</b:if>

Save your template and you're done! The CSS style credit of this widget goes to Web-Gate and Pagination Credit goes to Rilwis . Also wish to thank Paul Santhosh, who brought this idea forward. Hope this post help you and If you still in doubt ask via comments. Also share this article if you like. Happy blogging:)