Replace Older & Newer post links with post titles
The Newer Post, Home and Older Post links are located at the bottom of your blog. They are parts of blog pager, which help readers navigate between pages and posts. If you’ve ever been to a WordPress blog, you might have noticed that it displays the actual post titles, instead of fixed text phrases.
Blogger default vs. WordPress style blog pager
This tutorial will show you how to do just that -changing those static texts to dynamic post titles. Let’s get to work:
1. Loading jQuery library
This time we will use jQuery. For jQuery codes to work, first you have to load jQuery JavaScript library.
Go to Design > Edit HTML and paste this code before </head>
line in your template:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
Don’t add the code if your blog has some kind of slider/glider feature installed. It usually runs on jQuery, which means the code has been added to your template.
2. Adding the blog pager code
Go to Design > Page Elements > Add A Gadget and paste this code into a HTML/Javascript gadget. This code is based on the original code by Fiona of ETBlue.
<!-- Post title blog pager by BloggerSentral.com START --> <style type="text/css"> #blog-pager-newer-link {font-size:85%;width:200px;text-align:left;} #blog-pager-older-link {font-size:85%;width:200px;text-align:right;} </style> <script type="text/javascript"> $(document).ready(function(){ var newerLink = $("a.blog-pager-newer-link").attr("href"); $("a.blog-pager-newer-link").load(newerLink+" .post-title:first", function() { var newerLinkTitle = $("a.blog-pager-newer-link").text(); $("a.blog-pager-newer-link").text("<< " + newerLinkTitle); }); var olderLink = $("a.blog-pager-older-link").attr("href"); $("a.blog-pager-older-link").load(olderLink+" .post-title:first", function() { var olderLinkTitle = $("a.blog-pager-older-link").text(); $("a.blog-pager-older-link").text(olderLinkTitle + " >>");//rgt }); }); </script> <!-- Post title blog pager by BloggerSentral.com END -->
On post pages it will show the actual titles of the next and previous posts. On index pages (i.e. homepage, label pages and archive pages) it will show the titles of the topmost post of the next and previous index pages. A tooltip with “Newer post” or “Older post” will appear when you hover the post title, making sure readers can tell which is which.
Want to hide or change the appearance of the blog pager? Read Style your blog pager.
Enjoy!
62 comments to "Replace Older & Newer post links with post titles"
I have just done this as well, every time new good thing for my blog. Thanks!
very helpfull tut, thanks!
my facebook page widget is noy working pls help me out
very usefull tips...
thank you so much
@ahmmyreal
Please refer to Add a Facebook Like/Fan box to blogger.
@blogger_newbie
Thank you and welcome :)
Thanks,i shall try it out now
Hi,
Thanks for the this :)
please share some good Subscription Box theme/style with us.
i'm waiting for that even your one is good.
Regards.
nice tutorial for blogger. thanks a lot for sharing.hehehehe.
Hi, thanks for the tutorial. I want to ask, is that posibble to change position of the older post BELOW newer post?
Need ur reply. Thanks a lot
I can find my wordpress blog by searching for the title of the blog, however, if I search for a particular post title it will not come up. Is there any way of making this happen?Also, any tips on personalising it so it looks more like it's own website
@delphi
I see you've added this CSS snippet:
#blog-pager-older-link {font-size:100%;width:200px;text-align:right;}
replace it with this:
#blog-pager-older-link {font-size:100%;width:200px;text-align:left;float:left;clear:both;}
It's works. thanks. 2 more thing... he he...
First, I tried to make HOME link dissapear. But always failed. I tried to follow few tutorial but still failed.
Second, it's that possible to applying 2 navigation? U know, I imagine to apply number navigation for the global post, and UR navigation in the single post. I successed even on post body, but number navigation missing. And UR navigation being double (but I know what the problem for the double)
Sorry for my question. Thanks before.
@delphi
1. To make the HOME link disappear, go to Customizing blog pager (Home, Newer Post & Older Post links)
2. Use conditional tags. To apply the tags to a gadget/widget refer to Display widget on specific pages in Blogger
and to apply it to template Targeting specific pages/URLs with conditional tags
Terima kasih :)
Awak tahu Bahasa Melayu ke?
@Naim
Sama-sama.
Saya orang Melayu, dari Malaysia :)
terimakasih tips nya. sangat membantu..
wow, thank's Friend
tq 4 d tips..
ko mmg terbaek la.. byk aku bljr blogging dari sini
@phycrewz
Thanks, sekadar kongsi apa yang saya tau :)
Thanks, it worked for me but it is displaying the post title four times instead of one i.e. 'title title title title'
can anyone help me to solve this?
@Ravi
It looks okay now :)
how do i keep the older/newer posts in the index page (i.e. homepage, label pages and archive pages)...
Please help me...
I just want to replace the older/newer posts with post titles in the post pages only...
Can anyone help me ??
@idham
Use conditional tag, as explained in Display/hide widget on specific pages in Blogger
SyntaxHighlighter how to add that like in your blog please send me feed back to wonder.bajgain@gmail.com
@Anonymous
Here's a tutorial for that:
How to show code in blog post
thanks a lot for this post! it's very helpful. blogged about it and linked to your post as well :-)
This works great. I've been searching all morning, so I am happy now. :-)
Now, how do I move the newer/older post title navigation from the bottom to the top of blog post pages only and not the index page?
@Kurt Starnes
To move the pager to the top, read here
To target specific pages, read Display/hide widget on specific pages on Blogger
Oh my God, this is what I 've looking for all this time, thanks so much I've bookmark this post, btw may I repost this? of course I will write where I get it, this link post, thanks againOh my God, this is what I 've looking for all this time, thanks so much I've bookmark this post, btw may I repost this? of course I will write where I get it, this link post, thanks again
@Hans Ganteng
Yes you may repost it.
The best of tuts, very awesome!
Hi,
nice tip but is not working fine here ,no title post displayed just >> and <<:
http://juegos-de-guerra.blogspot.com/2011/03/encyclopedia-of-war-ancient-battles.html
Is not working at all in this 2 :
http://e-euros.blogspot.com/2011/05/matrixmailscom.html
http://e-econsultores.blogspot.com/2011/04/panfleto-union-sindical-trabajadores.html
any idea to fix this?
thanks in advance
@ed
For the first blog I think there is a conflict with the cufon font applied to post title.
As to the latter 2 blogs, I looks like the templates had the blog pager removed.
It's the most convenient for users as for me!
Mine is working but the comment numbers are also displayed along with the post titles... how do I get rid of the comment numbers?
@Jo Qusary
That's because your comment bubble are right in there with the post title:
[h3 class='post-title entry-title']
COMMENT BUBBLE CODE
...
[data:post.title/]
[/h3]
You need to move the bubble out of the h3 tag:
[h3 class='post-title entry-title']
...
[data:post.title/]
[/h3]
COMMENT BUBBLE CODE
Awesome code, thanks for sharing. Worked like a charm.
awesome tuttorial :) thanks for share
Just thought I'd mention...
I was having problems putting this on my blog and then after several attempts found the problem! You see where it says .post-title:first? As it turns out, on my custom blog, the post title is actually called entry-title and it's H1, not H3 (as in the code on ETBlue's page). So, if you're having trouble with this code, first see what the post title is called (CSS) on your blog, then switch .post-title:first (here) or h3:first (ETBlue) to whatever your post titles are classified as (you can find it in your CSS code).
This makes more bloggers look pretty, thx
Hello bro.
My older post, previous post not showing in my blog. i have been editting for 2 days long, the code is in the template, but i wonder why no older & previous post not appear. would you mine to check my blog? ive given up already. T_T
Dude its not working for me, your gadget code seems to be not working, please tell me what to do? i am getting nothing after applying your code on my blogspot blog.
I am confused between this code:
$("a.blog-pager-newer-link").load(newerLink+" .post-title:first"
What to type before :first ?? << i dont have post-title code in my HTML coding, may be the name of title is something else. Please tell me what i have to change to make this code works for me. You can check my blog source code in my signature. Thanks
@ZaaRz
Where is it? I don't see the code in your template.
@TechGlobeX
Looks like you've got it fixed.
This is very clever hack and the result is nice, but opening older and newer post using jQuery/javascript skews the stats :( Every visit in a post is counted as three hits in the stats.
So if one installs this, the rise in pageviews is not only because readers started browsing your blog more...
I think there is no easy way around this: if you want "exact" stats and exact post titles, titles should be fetched from feed, to make it not count on stats.
hello BlogSentral (or GreenLava)
i have a problem...
my blog template doesn't show the newer post, home or older post in my blog template..
can you please check and give me for the solutions? why it is not appear?
thank's in advance....
@The Script Wallpaper
I don't see the blog pager on pages other than post pages. I guess it was purposely customized that way.
cool!, nice info!
Your instructions is short but clear enough to guide me implement the tricks. Many thanks.
Cool! Used the conditional tag to display post titles only in item posts. Works brilliantly!
it's very cool
i luv jQuery trick
I tried this just now, but it doesn't seem to be working. I can still see Newer Post and Older Post. Please help.
@Cynthia Rodrigues Manchekar
Do not copy the code right off this page. Click the <> icon to view the raw code.
Nice post. Thanks for it..
It's cool, but not super-cool! The problem is that it loads 3 pages every time somebody opens your post. Completely! Looks like a bad thing to do. When I was thinking about the problem I discovered a better way to do that. See explanation here: http://blog-perevodov.blogspot.com/2012/09/blogger-replacing-older-and-newer-links.html. It's using external service to load titles saving users traffic, it also caches data making less delays. Check this out.
Thanks for the post
is this code showing in custom mobile template? anyway thanks for simple tutorial
@kang topjer
Ni, it doesn't work on mobile templates.
What a complete tutorial got to give it a try... very useful. Thank you
Thank you so much for this super easy tutorial. I have been trying for hours now, with the advice of several other tutorials, and no luck! This two step process worked wonders. Thank you!
terimkasih atas sharingnya kawan..
salam kenal dari Indonesia ..
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.