I am using jetpacks infinite scroll and it not fully works:
When using type="click" instead of type="scroll", then all works fine. A button is placed under the posts and when clicking further posts are loaded by infinite scroll. When using type="scroll", Then only one time it works and after that it does not load any more posts even posts to load exist. I cannot see any failure in debug mode or JavaScript console.
I have this in javaScript to track each load:
( function( $ ) {
$( document.body ).on( 'post-load', function () {
// New posts have been added to the page.
console.log('posts loaded...');
} );
} )( jQuery );
When using type="click", The "post-load" event is fired 5 times for each post-load. when using type="scroll", the "post-load" event is only fired 1 time and then no more posts are loaded. Bug?
When using 'posts_per_page' => 3, then type:scroll loads 3 times, but after that it does not load anymore (so it stops after 14 posts). When using 'posts_per_page' => 100, then all my posts are loaded (95) at once. Why is that so?