Add Infinite Scroll to WordPress Theme
Like Twitter, enable infinite scroll to your WordPress theme with jetpack plugin.This plugin having plenty of modules,unlike all modules infinite scroll not support for some themes.Now this issue fixed in jetpack,it's working perfectly in default WordPress themes and as well as all premium themes/frameworks.
Infinite Scroll to Well crafted WordPress Themes
What is well crafted WordPress themes really means ?, According to jetpack , default wordpress themes are well crafted themes.These themes supports infinite scrolling in your blog.it's very easy to enable infinite scrolling in that themes.
To add infinite scroll to WordPress themes like twenty twelve,twenty thirteen,twenty fourteen paste the following code to your functions.php file.
add_theme_support( 'infinite-scroll', array(
'container' => 'content',
'footer' => 'page',
) );
Infinite Scroll to unsupported WordPress themes
By default some WordPress themes doesn't support infinite scrolling.Adding this infinite scrolling makes tricky but possible.Copy and paste the following code to your wordpress themes's functions.php file.
function mytheme_infinite_scroll_init() {
add_theme_support( 'infinite-scroll', array(
'container' => 'content',
'render' => 'mytheme_infinite_scroll_render',
'footer' => 'wrapper',
) );
}
add_action( 'init', 'rootdip_infinite_scroll_init' );
Still it's not over,you need to setup Function for the Render Parameter. mytheme_infinite_scroll_init uses the WordPress loop to load additional posts for infinite scrolling.Add the below code to your themes's functions.php file.
function rootdip_infinite_scroll_render() {
get_template_part( 'loop' );
}
Adding infinite scrolling in WordPress themes is very easy with jetpack module.Need not to worry about supported and unsupported WordPress theme.
Getting error in wordpress or Jetpack infinite scroll still not working on your website.Consider using a infinite scroll WordPress plugin,which automatically append the next page of posts (via AJAX) to your page when a user scrolls to the bottom.