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
<?php get_header(); ?>
<main id="post-left-col" class="relative infinite-container" role="main">
<?php if (have_posts()) : while (have_posts()) : the_post();
get_template_part( 'template-parts/post/content' );
endwhile; endif;
?>
</main>
</div>
<?php get_footer(); ?>
content.php
<?php
/**
* Template part for displaying posts
*/
?>
<article id="post-area" class="infinite-post">
<!-- Insert your post format here e.g. <h1><?php the_title; ?></h1> etc..
Make sure to include
<div class="navigation"><?php next_post_link(); ?></div>
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.
jQuery(document).ready(function($) {
$('.infinite-content').cleverInfiniteScroll({
contentsWrapperSelector: '.infinite-container',
contentSelector: '.infinite-post',
nextSelector: '.navigation a:first'
});
});
Thanks to Paul Irish and Wataru for building upon the infinite scroll script.