To implement Infinite-scroll on Single.php
-
Hello,
I am trying to implement infinite scroll on the single.php file, like when we go bottom to the page then load another posts. But, I am getting tough time to implement this on the single.php file.
For this, I have added code in the functions.php file like mentioned on the below url
https://jetpack.com/support/infinite-scroll/
function zine_infinite_scroll_render(){
include(locate_template( ‘single-style1.php’ ) );
}
function zine_infinite_scroll_init() {
add_theme_support( ‘infinite-scroll’, array(
‘container’ => ‘cb-content’,
‘render’ => ‘zine_infinite_scroll_render’,
‘wrapper’ => false,
‘type’ => ‘scroll’,
‘posts_per_page’ => 6,
) );
}
add_action( ‘after_setup_theme’, ‘zine_infinite_scroll_init’ );But, its not showing infinite-scroll class in the body tag. Please help me on this to resolve the issue.
Thanks!
- The topic ‘To implement Infinite-scroll on Single.php’ is closed to new replies.