Add Load More Posts or Infinite Scrolling to Blogger

You might have seen the implementation of infinite scrolling at Facebook, Twitter or Google+. Instead of showing Older / Newer posts links, we can load posts dynamically whenever a "Load more posts" button is clicked, or by scrolling down the page. This tutorial will show you how to implement Ajax based loading script that will add Load More Posts or Infinite Scrolling to Blogger, so that visitors can easily navigate without reloading the page.

How it works?

- You have the option to add a 'Load More Posts' button or load automatically the older posts as visitors scroll down the page.
- Once implemented, Load More Posts / Infinite Scrolling applies to all Blogger posts on index pages (homepage, archive, label pages). It can't be added on individual posts.

Demo

To see it live, check out the demo below. When you scroll down to the bottom of the page, you will see the "Load More Posts" button. Once you click it, the next 3 posts set to display will load below.


Demo

Adding Load More Posts or Infinite Scrolling to Blogger

1. Log into your Blogger account and click on your blog where you want to add it. 
2. Go to 'Template' and click the 'Edit HTML' button to open the Template editor > click anywhere in the code area and press CTRL + F keys (or Command + F) to open the search box.


3. Type the tag below in the search box and press ENTER to find it:
</head>

4. Just above the </head> tag, add the following scripts/css styles:

a. If you want to load posts with 'Load More Posts' button like in the demo blog:

<script src='https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js'/><b:if cond='data:blog.pageType != &quot;static_page&quot;'><b:if cond='data:blog.pageType != &quot;item&quot;'><script type='text/javascript'>//<![CDATA[!function(a){function b(){h||(h=!0,d?(f.find("a").hide(),f.find("img").show(),a.ajax(d,{dataType:"html"}).done(function(b){var b=a("<div></div>").append(b.replace(k,"")),c=b.find("a.blog-pager-older-link");c?d=c.attr("href"):(d="",f.hide());b=b.find(g).children();a(g).append(b),window._gaq&&window._gaq.push(["_trackPageview",d]);window.gapi&&window.gapi.plusone&&window.gapi.plusone.go&&window.gapi.plusone.go();window.disqus_shortname&&a.getScript("http://"+window.disqus_shortname+".disqus.com/blogger_index.js");window.FB&&window.FB.XFBML&&window.FB.XFBML.parse&&window.FB.XFBML.parse();f.find("img").hide();f.find("a").show();h=!1})):f.hide())}function c(){var a=Math.max(i.height(),j.height(),document.documentElement.clientHeight),c=i.scrollTop()+i.height();0>a-c&&b()}var d="",f=null,g="div.blog-posts",h=!1,i=a(window),j=a(document),k=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;a(document).ready(function(){if("item"!=_WidgetManager._GetAllData().blog.pageType&&(d=a("a.blog-pager-older-link").attr("href"))){var g=a('<a href="javascript:;" >LOAD MORE POSTS</a>');g.click(b);i.scroll(c);f=a('<div class="load-more"></div>');f.append(g);f.append(e);f.insertBefore(a("#blog-pager"));a("#blog-pager").hide()}})}(jQuery);//]]></script><style type="text/css">.load-more{display:block;text-align:center;margin:20px auto;}.load-more a,.load-more a:hover{text-decoration:none;font:bold 11px Open Sans, sans-serif;letter-spacing:1px;padding:10px 20px;background:#000000;color:#ffffff;}</style></b:if></b:if> 

b. If you want to add the infinite scrolling without button, paste this instead:

<script src='https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js'/><b:if cond='data:blog.pageType != &quot;static_page&quot;'><b:if cond='data:blog.pageType != &quot;item&quot;'><script type='text/javascript'>//<![CDATA[!function(a){function b(){h||(h=!0,d?(f.find("a").hide(),f.find("img").show(),a.ajax(d,{dataType:"html"}).done(function(b){var b=a("<div></div>").append(b.replace(k,"")),c=b.find("a.blog-pager-older-link");c?d=c.attr("href"):(d="",f.hide());b=b.find(g).children();a(g).append(b),window._gaq&&window._gaq.push(["_trackPageview",d]);window.gapi&&window.gapi.plusone&&window.gapi.plusone.go&&window.gapi.plusone.go();window.disqus_shortname&&a.getScript("http://"+window.disqus_shortname+".disqus.com/blogger_index.js");window.FB&&window.FB.XFBML&&window.FB.XFBML.parse&&window.FB.XFBML.parse();window.twttr&&window.twttr.widgets&&window.twttr.widgets.load&&window.twttr.widgets.load();f.find("img").hide();f.find("a").show();h=!1})):f.hide())}function c(){var a=Math.max(i.height(),j.height(),document.documentElement.clientHeight),c=i.scrollTop()+i.height();150>a-c&&b()}var d="",f=null,g="div.blog-posts",h=!1,i=a(window),j=a(document),k=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;a(document).ready(function(){if("item"!=_WidgetManager._GetAllData().blog.pageType&&(d=a("a.blog-pager-older-link").attr("href"))){var g=a('<a href="javascript:;" >LOAD MORE POSTS</a>');g.click(b);i.scroll(c);f=a('<div class="load-more"></div>');f.append(g);f.append(e);f.insertBefore(a("#blog-pager"));a("#blog-pager").hide()}})}(jQuery);//]]></script></b:if></b:if>

Note: This code uses jQuery library, so if you already have jQuery on your page, please remove the line in red highlighted above.

5. Click 'Save template' button and check the 'Load More Posts' button / Infinite Scrolling in your Blogger blog.

Conclusion

That's it! So this is how we can easily add Load More Posts / Infinite Scrolling to Blogger. From now on, our visitors can stay in same page and navigate through infinite number of posts on the fly! 

COMMENTS

BLOGGER
Name

Ad Networks,4,Adsense,3,Adsense Alternative,2,Affiliate Marketing,3,ARTICLE WRITING,3,Aweber,1,BACKLINKING,1,Bitcoins,1,BLOG DESIGN,5,BLOGGER,19,BLOGGER NOTIFICATIONS,2,BLOGGER PLUGINS,23,BLOGGER POSTS,3,BLOGGER WIDGETS,16,Blogging,8,BLOGGING TIPS,28,Bluehost,1,Chitika,1,CHRISTMAS DECORATION,1,COMMENTS,2,Coupons,1,Email Marketing,2,FACEBOOK,3,Freelancing,1,GCS,1,Grammarly,1,help,1,How To,2,important points,1,JQUERY,2,Links,1,Make Money Online,14,NAVIGATION,1,New Year 2017,1,Nofollow Links,1,NOTIFICATIONS,1,online,2,Other,1,Outreach Emails,1,Parental control,1,POPULAR POSTS,1,Privacy,1,Review,5,RSS Feed,1,secure,1,seo,13,Shortcode,1,SOCIAL MEDIA,9,Start A Blog,3,Tech News,1,Tech Tips,2,TEMPLATE CUSTOMIZATION,15,Top Softwares,1,TRAFFIC TIPS,7,Web Hosting,2,WEBMASTER TOOLS,4,widgets,32,WordPress Plugins,1,WordzPress,1,WP THEMES,1,YouTube,2,
ltr
item
HV BLOGGERS: Add Load More Posts or Infinite Scrolling to Blogger
Add Load More Posts or Infinite Scrolling to Blogger
https://4.bp.blogspot.com/-Eo5RcSl-b94/WFYPfeObIAI/AAAAAAAABQU/IjUhvr3nnLUBsy-r6PtptvJJcZ9kfw8ygCLcB/s320/load-more-blogger-infinite-scrolling.png
https://4.bp.blogspot.com/-Eo5RcSl-b94/WFYPfeObIAI/AAAAAAAABQU/IjUhvr3nnLUBsy-r6PtptvJJcZ9kfw8ygCLcB/s72-c/load-more-blogger-infinite-scrolling.png
HV BLOGGERS
https://hvbloggers.blogspot.com/2016/12/add-load-more-posts-or-infinite_88.html
https://hvbloggers.blogspot.com/
https://hvbloggers.blogspot.com/
https://hvbloggers.blogspot.com/2016/12/add-load-more-posts-or-infinite_88.html
true
4122661956596859215
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy