Pages

Thursday, April 19, 2012

Replacing Older And Newer Links With Posts Titles

Let's try to replacing older and newer posts links with post title.
Here we go !!!
First, Login to Blogger, go to Dashboard › Design › Edit HTML › Backup template.
Put below script before </head> script:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>

Save template and go to Page Elements click for Add A Gadget pick HTML/JavaScript and put below script in it.
<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"); </ br>$("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>

Save it and look for the result by visiting homepage or one of your post.
Good luck.

Source: Change newer posts link and older posts link text, make them become real dynamic post titles - my Blogger template tweak

No comments:

Post a Comment

Archives