-->

Wednesday, 1 May 2013

0 How To Add Post Titles To Older Post Newer Post Links On Blogger





Step 1. In Your Blogger Dashboard Click Design > Edit Html


Step 2. Find the following piece of code in your blogs Html : (Click Ctrl and F for a search bar to help find the code)

</head>

Step 3. Copy and Paste the following code Directly Above / Before </head>

<script src='http://code.jquery.com/jquery-latest.js' type='text/javascript'/>

Step 4. Find the following piece of code in your blogs Html : (Click Ctrl and F for a search bar to help find the code

</body>

Step 5. Now Copy And Paste This Code Directly Above / Before </body>


<b:if cond='data:blog.pageType == &quot;item&quot;'>
<script type='text/javascript'>
// Post titles to Older Post and Newer Post links (without stats skew)
// by MS-potilas 2012. See http://yabtb.blogspot.com/2012/01/add-post-titles-to-older-and-newer-post.html
//<![CDATA[
var urlToNavTitle = {};
function getTitlesForNav(json) {
for(var i=0 ; i < json.feed.entry.length ; i++) {
var entry = json.feed.entry[i];
var href = "";
for (var k=0; k<entry.link.length; k++) {
if (entry.link[k].rel == 'alternate') {
href = entry.link[k].href;
break;
}
}
if(href!="") urlToNavTitle[href]=entry.title.$t;
}
}
document.write('<script type="text/javascript" src="http://'+window.location.hostname+'/feeds/posts/summary?redirect=false&max-results=500&alt=json-in-script&callback=getTitlesForNav"></'+'script>');
function urlToPseudoTitle(href) {
var title=href.match(/\/([^\/_]+)(_.*)?\.html/);
if(title) {
title=title[1].replace(/-/g," ");
title=title[0].toUpperCase() + title.slice(1);
if(title.length > 28) title=title.replace(/ [^ ]+$/, "...")
}
return title;
}
$(window).load(function() {
window.setTimeout(function() {
var href = $("a.blog-pager-newer-link").attr("href");
if(href) {
href = href.replace(/\.blogspot\.[^/]+\//, ".blogspot.com/");
var title=urlToNavTitle[href];
if(!title) title=urlToPseudoTitle(href);
if(title) $("a.blog-pager-newer-link").html("&lt;&lt; Newer Post<br />" + title);
}
href = $("a.blog-pager-older-link").attr("href");
if(href) {
href = href.replace(/\.blogspot\.[^/]+\//, ".blogspot.com/");
var title=urlToNavTitle[href];
if(!title) title=urlToPseudoTitle(href);
if(title) $("a.blog-pager-older-link").html("Older Post &gt;&gt;<br />" + title);
}
}, 500);
});
//]]>


Step 6. Find the following piece of code in your blogs Html : (Click Ctrl and F for a search bar to help find the code

]]></b:skin>

Step 7. Now Copy And Paste This Code Directly Above / Before ]]></b:skin>


.blog-pager-newer-link {background-color:transparent !important;padding: 0 !important;}
.blog-pager-older-link {background-color:transparent !important;padding: 0 !important;}
#blog-pager-newer-link {padding:5px;font-size:90%;width:200px;text-align:left;}
#blog-pager-older-link {padding:5px;font-size:90%;width:200px;text-align:right;}

Step 7. Save your template

Drop Your Comments And Questions Below.


Share this article :
Samarth Agarwal (Admin)
Posted By: Samarth Agarwal

Samarth Agarwal is the owner and founder of showmedreams.blogspot.com. I love to blogging,I like to learn and share technical hacking/security tips with you.

0 comments:

Post a Comment

Before Publishing Your Comment Please Click On Subscribe Button To Get Comments Update Direct Your Email

Subscribe via email

Subscribe via Email
 

Hi! Myself Samarth Agarwal (Pro Blogger and an addicted Web Developer)
1st of All I would like to thanks to all Followers and our lovely Visiters... Read More

Make Dashing Your Blog Copyright © 2016- All Rights Reserved
Designed by: Samarth Agarwal | Powered by: Showmedreams(SMD)