Infinite Scroll in ExpressionEngine

An ExpressionEngine tutorial which allows you to use Infinite Scroll on your entries. This method does not use an embed so overhead is minimal.

This method uses a forked version of infinite scroll which you can grab here. The forked version has an extractLink method which we can hook up with native ExpressionEngine pagination.

I’m using some standard ExpressionEngine Channel Entry tag markup with some pagination and my limit parameter set.

<div class="container">
{exp:channel:entries channel="articles" dynamic="no" orderby="date" sort="asc" status="not closed" paginate="bottom" limit="12"}
    <div class="article">
    <h2>{entry_id} - {title} </h2>
    <div class="pagination">
                <a href="{pagination_url}" class="newer">Previous Page</a>

                <a href="{pagination_url}" class="older">Next Page</a>


Pagination is key here as that is what we are using to generate our extra content for our Infinite Scroll. In the footer of your template link up jQuery and the forked version of jquery.infintescroll.js.

<script src="//"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.7.2.min.js"><\/script>')</script>
<script src="/assets/js/jquery.infinitescroll.js" type="text/javascript"></script>
<!-- <script src="/assets/js/jquery.masonry.min.js" type="text/javascript"></script> -->

Now we add our Infinite Scroll settings below that. Add your own URL for the pathParse function. Be sure to keep the P at the end of the URL. My method below includes some commented out code to integrate Masonry.


var $wall = $('.container');
//Masonry - Uncomment for use
columnWidth: 340,
isAnimated : true,
resizeable: true,
itemSelector : '.article'

//Infinite scroll
navSelector : 'div.pagination',
nextSelector : 'div.pagination a.older',
itemSelector : '.article',
loading: {
finishedMsg: "End of the line!",
img: "/assets/img/ajax-loader.gif",
msgText: "<em>Loading articles...</em>"
animate : true,
extraScrollPx: 150,
extractLink: true,

    pathParse: function() {
        return ['http://ws-expressionengine:8888/articles/P','']
debug: true,
errorCallback: function() {
// fade out the error message after 2 seconds
$('#infscr-loading').animate({opacity: .8},2000).fadeOut('normal');
// Call Masonry as a callback - Uncomment for use
function( newElements ) {
var $newElems = $( newElements );
$(this).masonry( 'appended', $newElems );


You can grab a more complete template example here.