Hello, I found this thread on adding Jetpack’s infinite scroll to X Theme’s blog and have successfully implemented it on my website here.
I would like to enable infinite scroll on my portfolio index page as well. Based on what I know, the jetpack_infinite_scroll_render
function needs to render the portfolio posts. I tried to change it from this:
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;
}
to this:
function jetpack_infinite_scroll_render() {
if (get_post_type() == 'post') {
$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;
} else if (get_post_type() == 'x-portfolio') {
x_get_view( 'integrity', 'content', 'portfolio');
}
}
To no avail. I have tried a couple different attempts, but the portfolio page remains the same.
Not sure if there are additional steps for applying infinite scroll to CPT, or if I am not getting the rendering code correctly. Any help would be greatly appreciated!