I'm using the Underscores theme which comes with the following (very) handy code in inc/jetpack.php
add_theme_support( 'infinite-scroll', array(
'container' => 'main',
'render' => 'infinite_scroll_render',
'footer' => 'page',
'wrapper' => false
) );
function infinite_scroll_render() {
while ( have_posts() ) {
the_post();
if ( is_search() ) :
get_template_part( 'template-parts/content', 'search' );
else :
get_template_part( 'template-parts/content-', get_post_type() );
endif;
}
}
I can't figure out the best way to edit either of these functions to ignore a particular post type. I can pass if( is_post_type_archive('service') )
but if I just 'return' then the rest of the page doesn't render - it just stops there.
How can I specify which post types Infinite Scroll fires on?