Last active
August 10, 2017 03:11
-
-
Save DeveloperWil/666f8771117e987cbb6d to your computer and use it in GitHub Desktop.
[WordPress] Code from our blog post Integrating JetPack Infinite Scroll with Genesis - https://zeropointdevelopment.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 zpd_infinite_scroll_init() { | |
add_theme_support( 'infinite-scroll', array( | |
'container' => 'content', | |
'footer' => 'footer', | |
'render' => 'genesis_do_loop' | |
) ); | |
} | |
add_action( 'after_setup_theme', 'zpd_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', 'zpd_custom_attributes_content' ); | |
function zpd_custom_attributes_content( $attributes ) { | |
$attributes['id'] = 'main-content'; | |
return $attributes; | |
} | |
/** | |
* Add support for JetPack infinite scroll | |
**/ | |
function zpd_infinite_scroll_init() { | |
add_theme_support( 'infinite-scroll', array( | |
'container' => 'main-content', | |
'footer' => 'footer', | |
'render' => 'genesis_do_loop' | |
) ); | |
} | |
add_action( 'after_setup_theme', 'zpd_infinite_scroll_init' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment