I'm making a new blog for a startup who want a similar infinite scrolling effect to http://qz.com/
It also needs to include the URL changing as seen within the previously mentioned link.
For the life of me I can't figure out how it's done, I think it uses the HTML5 History API, but I also had it working in internet explorer so maybe it doesn't?
I would be incredibly grateful if someone could give me some pointers on how to make this work (using WordPress).
If anyone is looking to implement infinite scroll on WordPress, use Wataru's Infinite Scroll with URL cycling Script
Download the script, enqueue it in the footer or concatenate it with gulp or however you choose to use it.
How to implement infinite scroll in WordPress:
1) Organize your post content like so:
Single.php
content.php
Make sure to include
at the end of your content.php post template.
2) Set up your infinite scroll configuration. This, of course, can be included in your main javascript file. Any of the below selectors can have their name changed.
Thanks to Paul Irish and Wataru for building upon the infinite scroll script.
My friend asked me the same. So I made a plugin for it. I think this is what you want.
https://github.com/wataruoguchi/clever-infinite-scroll
This is the process of how to change the URL using infinite scrolling.
history.pushState()
. URL and title both strings are gotten from hidden span elements.You may like to try Project Sarus
https://github.com/srijanlabs/sarus
It implements same functionality and is highly customizable.
It is a frontend framework built in AngularJS so it can be used with wordpress in the backend. All you need to do is to expose the RSS or create an API. Else you may try to integrate it in wordpress html itself.
You can use infinite scroll to your WordPress theme by add some functions. And also you can activate this feature by using jetpack plugin. Basically it's using AJAX.
The most straight forward way to do it would be to change the URL hash after each element is scrolled past. You could save this in a cookie and load it if the user returns to the page.
There seems to be a more advanced version of this using the History API as you mentioned, there is a good writeup here, this method does not support IE9 or earlier though.