Hello there,
I recently followed a tutorial (Jetpack infinite scroll & X Theme) to implement scrolling. Its work great on archive pages, but how can I do the same for our individual blog posts?
Can you please guide me here?
Thanks!
Here is the function I used.
// Add theme support for Jetpack infinite scroll
<?php } // =======================
// =======================
add_action( ‘after_setup_theme’, ‘jetpack_infinite_scroll_init’ );
function jetpack_infinite_scroll_init() {
add_theme_support( ‘infinite-scroll’, array(
‘container’ => ‘content’,
‘render’ => ‘jetpack_infinite_scroll_render’,
‘posts_per_page’ => get_option( ‘posts_per_page’ ),
‘footer’ => false,
‘footer_widgets’ => false,
‘footer_callback’ => ‘no_jetpack_footer’,
) );
}
// Render the posts
function jetpack_infinite_scroll_render() {
$is_filterable_index = is_home() && x_get_option( ‘x_ethos_filterable_index_enable’ ) == ‘1’;
if ( $is_filterable_index ) :
x_get_view( ‘ethos’, ‘_index’ );
else :
x_get_view( ‘global’, ‘_index’ );
endif;
}
// (remove Jetpack’s annoying popup footer)
function no_jetpack_footer() { ?>