Customizing blog pager (Home, Newer Post & Older Post links)
This tutorial will show you five ways of changing the look of a Blogger blog pager. Blog pager are those “Newer Post(s)”, “Home” and “Older Post(s)” links at the bottom of your blog page. Here they are:
- Changing the text with your own text .
- Replacing the text with an image.
- Switch sides between “Newer Post(s)” and “Older Post(s)”.
- Adding background to the text.
- Removing the pager from page.
Okay let’s proceed. First you have to find the blog pager code.
- Login to your Blogger account.
- Go to Dashboard > Design > Edit HTML.
- Back up your template.
- Tick the Expand Widget Templates check box on top right of the HTML window.
- Look for following code:
<b:includable id='nextprev'> <div class='blog-pager' id='blog-pager'> <b:if cond='data:newerPageUrl'> <span id='blog-pager-newer-link'> <a class='blog-pager-newer-link' expr:href='data:newerPageUrl' expr:id='data:widget.instanceId + "_blog-pager-newer-link"' expr:title='data:newerPageTitle'><data:newerPageTitle/></a> </span> </b:if> <b:if cond='data:olderPageUrl'> <span id='blog-pager-older-link'> <a class='blog-pager-older-link' expr:href='data:olderPageUrl' expr:id='data:widget.instanceId + "_blog-pager-older-link"' expr:title='data:olderPageTitle'><data:olderPageTitle/></a> </span> </b:if> <b:if cond='data:blog.homepageUrl != data:blog.url'> <a class='home-link' expr:href='data:blog.homepageUrl'><data:homeMsg/></a> <b:else/> <b:if cond='data:newerPageUrl'> <a class='home-link' expr:href='data:blog.homepageUrl'><data:homeMsg/></a> </b:if> </b:if> </div> <div class='clear'/> </b:includable>
You want to take notice three data tags in line 5, 10, 14 and 17. Below are the three data tags and their corresponding link texts.
Data tag | Link text |
<data:newerPageTitle/> |
Newer Post(s) |
<data:homeMsg/> |
Home |
<data:olderPageTitle/> |
Older Post(s) |
1. Changing the text with your own
To change the link text with your own, just replace the data tag with your intended text, for example if you want to replace “Newer Post(s)” with “Newer Entries”, just replace
<data:newerPageTitle/>
with Newer Entries
Note: Special characters such as “/”, “<”, “>” and quotation mark need to be converted to escaped characters, otherwise Blogger will interpret it as a part of your template code, which could potentially mess up your template. You can convert it with Quick Escape.
2. Replacing the text with an image
To use an image, replace the data tag with this:
<img src="YOUR_IMAGE_URL" />
YOUR_IMAGE_URL is the URL of the image that you are replacing the link text with.
3. Switch sides between “Newer Post(s)” and “Older Post(s)”
If you want to switch sides between “Older Post(s)” and “Newer Post(s)”, look for something like this in the CSS section of your template code:
#blog-pager-newer-link { font-size:12px; float: left; } #blog-pager-older-link { font-size:12px; float: right; }
just switch the floats - float:left;
to float:right;
and vice versa.
4. Adding background to the text
This can be done in CSS by applying background code to the respective HTML element classes, namely .blog-pager-older-link
, .home-link
and .blog-pager-newer-link
.
For example to apply green background to “Older Post(s)”, use:
.blog-pager-older-link {background: #00FF00;}
To use an image as a background, use:
.blog-pager-older-link {background: url(YOUR_IMAGE_URL) no-repeat;}
5. Removing the pager from page
Two ways of achieving this:
- Actually remove the HTML element -by deleting the above HTML code.
- Hide it, using CSS
display:none
. I prefer this method because it is easy to apply and easy to undo.For example if you want to remove the “Home” link, just add this code:
.home-link {display:none}
and if you want to remove all three links at once, use this:
#blog-pager {display:none}
To unhide, simply remove the added code.
Add the CSS code snippet (in no.4 and 5) right before ]]></b:skin>
in your template. You can also add the CSS code snippets using custom CSS editor.
Want to replace Newer Post and Older Post texts with the actual post titles? Read Replace Older & Newer post links with post titles.
Enjoy!
34 comments to "Customizing blog pager (Home, Newer Post & Older Post links)"
I have a product that crafter use and I would like to have a blog page where crafters could share specific uses for the product and share pictures of their finished pages and we would like to share pictures of finished goods.
nice info..
oya.., how to change olderPageTitle with title post?
thanks from Kerja Keras Adalah Energi Kita
Logo Designs,
I can't think of any Blogger hack/gadget that can do what you described.
The only thing that comes to mind is TwitPic (that enables you to share photos on Twitter).
kerja keras adalah energi kita,
I thought it, but haven't figured out how.
Hi GL,
I have a problem with a huge white space between the comment box and the pager links. It only happens on individual pages where the comments are expanded. Every other page looks okay as far as I can tell.
Is there anything I can do about decreasing the white spoace?
As always, thank you so much!
Rebecca,
I'm afraid there's nothing much you can do about it. The comment form is an iframe embedded by Blogger. We have no access to it.
Its a very informative and useful info for all blogger doesn't matter he is new or experienced. Thanks for this info.
Thanks! I was able to change the text, switch sides, and add a color background, but NOT swap out the text with icons for some odd reason.
BTW, the floats were not left and right but rather startside and endside, but I understood your instructions. Good enough for me. Thanks again!
Hi Greenlava,
Have you figured out how to change the link text with title post? It is nice to see on other blogs. On saiful islam dot com for an eg.
One more thing, how to put that pager navigation at above post title?
Khairi,
Nope, haven't figured it out yet. Saiful islam dot com runs on Wordpress, I think it's easier to get that done in Wordpress.
Hi GL
I love your blog.. Although I came your blog recently, I have almost each and every post and all very informative as useful.
Meanwhile. I have an issue with my blog's new template.. I cant find the Blog Pager on the main page as well as on individual blog post.
Here is my Blog : http://kantspot.blogspot.com/
I love this template but because of the lack of navigation, i dont think it will be supportive
This theme was created by StudioPress and converted into Blogger Template By Bloganol when i asked the same query via comment, he has deleted the comment as well now
Can you please help me ..
Swamykant,
Did you tick the Expand Widget Templates checkbox before searching for the code?
GL, it's been a while!
My issue is the blog-pager. I simply use newer-home-older. These show up on all pages they should EXCEPT pages accessed through my archive and ONLY when a week of posts are selected from the archive. My archive is a weekly hierarchy.
When a single post from the archive is selected the pager looks fine, but when an entire week is selected I get dates of the newer and older posts instead of the terms "newer" and "older." For example, 20102102-home-20102001 (with appropriate spacing of course).
It's not at all obvious that these numbers are dates. Is there a way I can get these to say newer and older instead? I looked, but I'm stumped. Would you mind taking a look? Or if you need more info from me, please let me know.
Thanks!
@Rebecca
Hey welcome back :)
Are you talking about the Healthcare Reform blog? They (the link texts) look okay from here.
Thanks for the article, it was really very helpful, but could you please answer one more stupid question: ho do I put the Pager bar on the top of the page rather than on the bottom of the page.
Thanks!
@Sasha Obriza
I can't say for sure without seeing your template code, but you can try this:
In Layout>Edit HTML, with Expand Widget Templates ticked, find this code (replace [] with <>):
[!-- navigation --]
[b:include name='nextprev'/]
make sure it's "include", and not "includable".
reposition it below this code:
[b:includable id='main' var='top']
Make sure you preview first before saving.
@Greenlava
Oh thank you so much!
It did work from the first attempt :)
Thanks again!
@Sasha Obriza
Great! don't forget to subscribe to Blogger Sentral posts feed :)
Thank you for your tutorial on how to customize new and older post links. How can one either remove the dotted, bullet line in between the "older" and "newer"? Is it possible to add a solid line above and below them?
thank you
http://www.betovargas.com
@Beto Vargas
Go to Design > Edit HTML and find this:
.blog-pager {
background: transparent url(http://www.blogblog.com/1kt/simple/paging_dot.png) repeat-x scroll top center;
}
replace it with this:
.blog-pager {
border-bottom:1px solid grey;
border-top:1px solid grey;
}
Thank you for this:
@Beto Vargas
Go to Design > Edit HTML and find this:
.blog-pager {
background: transparent url(http://www.blogblog.com/1kt/simple/paging_dot.png) repeat-x scroll top center;
}
replace it with this:
.blog-pager {
border-bottom:1px solid grey;
border-top:1px solid grey;
}
I have been looking for days for this info!!!
how do i change the pager font?
@Sydney
Use this CSS code:
#blog-pager {font-family: 1st CHOICE FONT,2nd CHOICE FONT;}
for example:
#blog-pager {font-family: Georgia,serif;}
Loved the way you have presented this tutorial... everything related to newer/older links in one place. I just replaced the text of the "home" link with an image. Also used your other tutorial for showing post titles instead of older/newer post. Now it looks just perfect! :D
I'll try to use this on my blogger blog.
Thanks!
How to display the page title instead of Older Post and Newer Post?
@Gowtham Gutha
There's a post for that, here:
Replace Older & Newer post links with post titles
thanks buddy. replaced older, newer with images and it worked great ;)
Thank you!! :)
Thank you......!
Thanks for this information.
thks!nice for sharing!
I really thank you for sharing his good blog,i get a lot of important info from this...
amazing! Thank you for sharing this valuable info!
Post a Comment
We love to hear from you! Leave us a comment.
To ensure proper display, HTML/XML/Javascript need to be escaped first using this escape tool.