Skip to content

Instantly share code, notes, and snippets.

@zeropointdevelopment
Last active January 1, 2016 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeropointdevelopment/8142925 to your computer and use it in GitHub Desktop.
Save zeropointdevelopment/8142925 to your computer and use it in GitHub Desktop.
[WordPress] Code from our blog post Integrating JetPack Infinite Scroll with Genesis - http://www.limecanvas.com/integrating-jetpack-infinite-scroll-with-genesis/
/**
* Add support for JetPack infinite scroll
**/
function lc_infinite_scroll_init() {
add_theme_support( 'infinite-scroll', array(
'container' => 'content',
'footer' => 'footer',
'render' => 'genesis_do_loop'
) );
}
add_action( 'after_setup_theme', 'lc_infinite_scroll_init' );
/**
* Add a CSS ID to main element
**/
add_filter( 'genesis_attr_content', 'lc_custom_attributes_content' );
function lc_custom_attributes_content( $attributes ) {
$attributes['id'] = 'main-content';
return $attributes;
}
/**
* Add support for JetPack infinite scroll
**/
function lc_infinite_scroll_init() {
add_theme_support( 'infinite-scroll', array(
'container' => 'main-content',
'footer' => 'footer',
'render' => 'genesis_do_loop'
) );
}
add_action( 'after_setup_theme', 'lc_infinite_scroll_init' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment