Skip to content

Instantly share code, notes, and snippets.

@ryelle
Created October 28, 2015 16:32
Show Gist options
  • Select an option

  • Save ryelle/c9027d3efd9f271c16c0 to your computer and use it in GitHub Desktop.

Select an option

Save ryelle/c9027d3efd9f271c16c0 to your computer and use it in GitHub Desktop.
Jetpack For Developers: Infinite Scroll example
<?php
function prefix_jetpack_setup(){
add_theme_support( 'infinite-scroll', array(
'type' => 'click',
'container' => 'main',
'posts_per_page' => 12,
'footer' => 'page',
'render' => 'prefix_is_render',
) );
}
function prefix_is_render() {
// Only needed if your loop is different than
while( have_posts() ) : the_post();
get_template_part( 'content', get_post_format() );
endwhile;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment