This post explains how to add numbered page navigation widget to blogger (blogspot) blogs:
What is Numbered Page Navigation ?
In blogger, by default, you see Older posts, Newer Posts links near the bottom of the page which is useful to your blog visitors to navigate to other posts of your blog. But, the problem is.. people hardly notice those newer and older posts links.. which means.. less pageviews to your blog.
So, to increase your blog pageviews you can use this cool looking, advanced numbered page navigation to your blog.
So, how to add this to your Blogger blog ?
(first backup your blog template before editing anything)
1. Sign into your Blogger account » Settings » Formatting
Choose the number of posts you want to display on homepage

2. Go to Design » Edit html » tick the expand widget templates
Scroll down to the bottom of the template code and find this
</body>
PASTE this code above that line
<b:if cond='data:blog.pageType != "item"'>
<b:if cond='data:blog.pageType != "static_page"'>
<script type='text/javascript'>
var pageCount=5;
var displayPageNum=5;
var upPageWord ='Previous';
var downPageWord ='Next';
</script>
<script type='text/javascript'>
//<![CDATA[
function showpageCount(json){var thisUrl=home_page_url;var htmlMap=new Array();var thisNum=1;var postNum=1;var itemCount=0;var fFlag=0;var eFlag=0;var html='';var upPageHtml='';var downPageHtml='';for(var i=0,post;post=json.feed.entry[i];i++){var timestamp1=post.published.$t.substring(0,19)+post.published.$t.substring(23,29);timestamp=encodeURIComponent(timestamp1);var title=post.title.$t;if(title!=''){if(itemCount==0||(itemCount%pageCount==(pageCount-1))){if(thisUrl.indexOf(timestamp)!=-1){thisNum=postNum}if(title!='')postNum++;htmlMap[htmlMap.length]='/search?updated-max='+timestamp+'&max-results='+pageCount}}itemCount++}for(var p=0;p<htmlMap.length;p++){if(p>=(thisNum-displayPageNum-1)&&p<(thisNum+displayPageNum)){if(fFlag==0&&p==thisNum-2){if(thisNum==2){upPageHtml='<span class="showpage"><a href="/">'+upPageWord+'</a></span>'}else{upPageHtml='<span class="showpage"><a href="'+htmlMap[p]+'">'+upPageWord+'</a></span>'}fFlag++}if(p==(thisNum-1)){html+='<span class="showpagePoint">'+thisNum+'</span>'}else{if(p==0){html+='<span class="showpageNum"><a href="/">1</a></span>'}else{html+='<span class="showpageNum"><a href="'+htmlMap[p]+'">'+(p+1)+'</a></span>'}}if(eFlag==0&&p==thisNum){downPageHtml='<span class="showpage"> <a href="'+htmlMap[p]+'">'+downPageWord+'</a></span>';eFlag++}}}if(thisNum>1){html=''+upPageHtml+' '+html+' '}html='<div class="showpageArea" style="padding:10px 10px 10px 10px;"><span style="COLOR: #000;" class="showpageOf"> Pages ('+(postNum-1)+')</span>'+html;if(thisNum<(postNum-1)){html+=downPageHtml}if(postNum==1)postNum++;html+='</div>';var pageArea=document.getElementsByName("pageArea");var blogPager=document.getElementById("blog-pager");if(postNum<=2){html=''}for(var p=0;p<pageArea.length;p++){pageArea[p].innerHTML=html}if(pageArea&&pageArea.length>0){html=''}if(blogPager){blogPager.innerHTML=html}}function showpageCount2(json){var thisUrl=home_page_url;var htmlMap=new Array();var isLablePage=thisUrl.indexOf("/search/label/")!=-1;var thisLable=isLablePage?thisUrl.substr(thisUrl.indexOf("/search/label/")+14,thisUrl.length):"";thisLable=thisLable.indexOf("?")!=-1?thisLable.substr(0,thisLable.indexOf("?")):thisLable;var thisNum=1;var postNum=1;var itemCount=0;var fFlag=0;var eFlag=0;var html='';var upPageHtml='';var downPageHtml='';var labelHtml='<span class="showpageNum"><a href="/search/label/'+thisLable+'?&max-results='+pageCount+'">';var thisUrl=home_page_url;for(var i=0,post;post=json.feed.entry[i];i++){var timestamp1=post.published.$t.substring(0,19)+post.published.$t.substring(23,29);timestamp=encodeURIComponent(timestamp1);var title=post.title.$t;if(title!=''){if(itemCount==0||(itemCount%pageCount==(pageCount-1))){if(thisUrl.indexOf(timestamp)!=-1){thisNum=postNum}if(title!='')postNum++;htmlMap[htmlMap.length]='/search/label/'+thisLable+'?updated-max='+timestamp+'&max-results='+pageCount}}itemCount++}for(var p=0;p<htmlMap.length;p++){if(p>=(thisNum-displayPageNum-1)&&p<(thisNum+displayPageNum)){if(fFlag==0&&p==thisNum-2){if(thisNum==2){upPageHtml=labelHtml+upPageWord+'</a></span>'}else{upPageHtml='<span class="showpage"><a href="'+htmlMap[p]+'">'+upPageWord+'</a></span>'}fFlag++}if(p==(thisNum-1)){html+='<span class="showpagePoint">'+thisNum+'</span>'}else{if(p==0){html=labelHtml+'1</a></span>'}else{html+='<span class="showpageNum"><a href="'+htmlMap[p]+'">'+(p+1)+'</a></span>'}}if(eFlag==0&&p==thisNum){downPageHtml='<span class="showpage"> <a href="'+htmlMap[p]+'">'+downPageWord+'</a></span>';eFlag++}}}if(thisNum>1){if(!isLablePage){html=''+upPageHtml+' '+html+' '}else{html=''+upPageHtml+' '+html+' '}}html='<div class="showpageArea"><span style="COLOR: #000;" class="showpageOf"> Pages ('+(postNum-1)+')</span>'+html;if(thisNum<(postNum-1)){html+=downPageHtml}if(postNum==1)postNum++;html+='</div>';var pageArea=document.getElementsByName("pageArea");var blogPager=document.getElementById("blog-pager");if(postNum<=2){html=''}for(var p=0;p<pageArea.length;p++){pageArea[p].innerHTML=html}if(pageArea&&pageArea.length>0){html=''}if(blogPager){blogPager.innerHTML=html}}var home_page_url=location.href;var thisUrl=home_page_url;if(thisUrl.indexOf("/search/label/")!=-1){if(thisUrl.indexOf("?updated-max")!=-1){var lblname1=thisUrl.substring(thisUrl.indexOf("/search/label/")+14,thisUrl.indexOf("?updated-max"))}else{var lblname1=thisUrl.substring(thisUrl.indexOf("/search/label/")+14,thisUrl.indexOf("?&max"))}}var home_page="/";if(thisUrl.indexOf("?q=")==-1){if(thisUrl.indexOf("/search/label/")==-1){document.write('<script src="'+home_page+'feeds/posts/summary?alt=json-in-script&callback=showpageCount&max-results=99999" ><\/script>')}else{document.write('<script src="'+home_page+'feeds/posts/full/-/'+lblname1+'?alt=json-in-script&callback=showpageCount2&max-results=99999" ><\/script>')}}
//]]>
</script>
</b:if>
</b:if>
In that above code, Edit the part that I highlighted in red color according to Step 1. It determines the number of posts that to be displayed per page. (Make sure, the number you set is same like the one in Step 1)
3. Control + F and search for all the occurrences of this code
'data:label.url'
and replace it with this
'data:label.url + "?&max-results=5"'
Again, the number in the above line depends on the number you set in the STEP 1.
4. Now, the styling part.. I've made x styles.. you can choose the one you wish..
(i) Default

Code
.showpageArea a {
text-decoration:underline;
background: #ffffff;
padding: 10px 10px 10px 10px;
}
.showpageNum a {
text-decoration:none;
border: 1px solid #cccccc;
border-top: 1px solid #cccccc;
margin:0 3px;
padding:3px;
}
.showpageNum a:hover {
border: 1px solid #cccccc;
background-color:#cccccc;
}
.showpagePoint {
color:#333;
text-decoration:none;
border: 1px solid #cccccc;
background: #cccccc;
margin:0 3px;
padding:3px;
}
.showpageOf {
text-decoration:none;
padding:3px;
margin: 0 3px 0 0;
}
.showpage a {
text-decoration:none;
border: 1px solid #cccccc;
padding:3px;
}
.showpage a:hover {
text-decoration:none;
}
.showpageNum a:link,.showpage a:link {
text-decoration:none;
color:#333333;
}
Copy the above code. Find this line and paste that code ABOVE IT.
]]></b:skin>
Save the changes.
I've made a few more navigation styles.. I'll post them in a few min.. look for it.
Credits: Blogger Plugins
Subscribe to:
Post Comments (Atom)








22 comments:
Excellent Kranthi :)
Really You are Genius
You are making our blog so great by providing excellent widgets
i'm using Artisteer Template creator. SO how can i get this work on my blog. :(
I have try it, but still seen older post link.
Awesome! I've added this hack to my blog: Hack Tutors. Have a look :)
Thanks for sharing!
Really great... my blog is looking cool now.. thanks Kranthi
Excellent Widgets, Thanks
wow nice dear great sharing kranthi check out my blog http://onlinewatchmoviees.blogspot.com/
omg!!!!! i am so happy for my blog now its becoming more professional by the way of widgets provided by you love u awesome and thanx again
hi everybody,
i have followed the instruction step by step and on my blog it doesn`t seem to work.
Can someone please help me make it work on my blog?
http://www.free2watch-movies.blogspot.com
i didn't found that code 'data:label.url'
but thank u anyway,
http://becometall.blogspot.com/
Thanks for the nice Trick for blogger. I have successfully added the same. I want to learn how can I add HTML Codes in Blogger posts. Can u guide me about that !
Looking for your quick reply !!!
this is awesome user friendly navigation
@k 47,
You've to first covert the html code using the Blogger Code Converter .
Next.. you've to paste that code in ' HTML ' mode in blogger posts.. between the {code} and {/code} tags..
Replace { and } with < and >
@ Kranthi ! Thanks for the nice tip ! I used it on my blog and it was successful for me ! I am very thankful to you for the help ! I will be the regular member of your blog ! Can I add this convertor to my blog !!!
Thanks again !!
thanks, this is so helpfull!
Nice :)
You can add more styles to your blogger page numbers by using tricks from here http://www.folsol.com/show-blogger-page-numbers-in-blogspot-blogs.html
Admin of the blog I have modified my blog HTML code for something and now there is type='text/javascript'/> coming on the end of each page ! Please help me to resolve. An urgent reply will be appreciated. Asif Khattak
Great Trick...
I have different catagories.
How can I add this for each catagory?
Thanks A Bundle
@ AK,
whts ur blog url.. ?
@urdusms,
It automatically shows numbered navigation in category/lable pages.. You don't need to edit anything..
Kranthi, once again Bravo to you!
Really, thankful post. I hope you'll also love this one.
Update your multiple wordpress/Blogger blog directly from facebook
I hope you'll love my tutorial.
Regards,
suraZ from HackTweak
Very nice! Thanks for sharing. : )
I didn't Find this code'data:label.url'