Monday, November 30, 2015

How to Replace Older Posts and Newer Posts Links to the Next or Previous Post Title

Blogger blogs tend to be tricky when you want to customize them.
It is doable, you just have to find the right coding.

I love coding that is easily accessible after you've altered your site.

This change that I'm sharing with you today, is super simple to implement, and very easy to remove if you want.


If you'll notice, at the bottom of my blog, I now have links to the previous or next post title, rather than the standard Blogger, "Newer Post"/"Older Post" links.  

To make this change, simply go to your Layout.

1.  Click "Add Gadget"
2.  Add Html/Java Script
3. Copy and paste the code below.
4.  Save
5.  Move (Click and Drag) the new html below your Blog Posts section.
6.  Save Arrangement.

Easy Peasy, Lemon Squeezy!


Here's the coding:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
var olderLink = $("a.blog-pager-older-link").attr("href");
$("a.blog-pager-older-link").load(olderLink+" h3:first", function() {
var olderLinkTitle = $("a.blog-pager-older-link:first").text();
$("a.blog-pager-older-link").text(olderLinkTitle);
});
var newerLink = $("a.blog-pager-newer-link").attr("href");
$("a.blog-pager-newer-link").load(newerLink+" h3:first", function() {
var newerLinkTitle = $("a.blog-pager-newer-link:first").text();
$("a.blog-pager-newer-link").text(newerLinkTitle);
});
</script>


*************************************************************************
((The red portion is to be used ONLY if you have not implemented the jQuery Framework.  If you have already done this (added another jQuery function on your site), you can omit the red portion of the coding.


Happy blogging, everyone!

-Heather

2 comments:

  1. Thanks a bunch I actually GOT IT! Any more blogger tips that can help an old lady like me??

    ReplyDelete

It makes my day to get a comment from readers... like you! Let me know what you think... if you've tried it before... and any tips you may have!