Created
October 24, 2013 19:46
-
-
Save srikat/7143767 to your computer and use it in GitHub Desktop.
Jetpack Infinite Scroll in Genesis. http://sridharkatakam.com/jetpacks-infinite-scroll-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 a CSS ID to main element | |
add_filter( 'genesis_attr_content', 'custom_attributes_content' ); | |
function custom_attributes_content( $attributes ) { | |
if ( is_home() || is_archive() ) { | |
$attributes['id'] = 'main-content-area'; | |
} | |
return $attributes; | |
} | |
//* Add support for Jetpack infinite scroll | |
add_theme_support( 'infinite-scroll', array( | |
// 'type' => 'click', | |
'container' => 'main-content-area', | |
'render' => 'genesis_do_loop' | |
) ); | |
//* Remove archive pagination | |
// add_action ( 'genesis_after_entry', 'sk_remove_pagination' ); | |
function sk_remove_pagination() { | |
remove_action( 'genesis_after_endwhile', 'genesis_posts_nav' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment