Last active
January 1, 2016 12:09
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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