Jetpack Infinite Scrolling For Multiple Columns On Same Page?

I’ve checked the source code for Slim Jetpack and this task can not be accomplished without rewriting that plugin.

Here are some hints:

  1. You’ll have to duplicate line 539 of ‘/modules/infinity-scroll/infinity.php’ stating:

    jQuery.extend( infiniteScroll.settings.scripts, <?php echo json_encode( $scripts ); ?> );
    
  2. You’ll have to duplicate line 475 of ‘/modules/infinity-scroll/infinity.js’ as this initializes infinite scroll. (Do you see the variable name match?)

    infiniteScroll.scroller = new Scroller( infiniteScroll.settings );
    
  3. What’s more, you’ll have to tweak the module to accept more attributes, or at least post_type attribute to be able to determine what post_type to bring for each inifinite loop — this must be done in both JS and PHP (callback for ajax function).

As I’ve said, the plugin would have to be rewritten.

Leave a Comment