Enabling infinite scrolling is as simple as adding this snippet to the theme’s functions.php file (where ‘content’ is the id
of the container that wraps the posts):
add_theme_support( 'infinite-scroll', array(
'type' => 'scroll',
'container' => 'content',
'footer' => false,
) );
But what should I do if my website has a multiple column layout where, for instance, one column shows the latest posts, and the other column lists the latest posts from a tag (highlights)? i.e. essentially there are two containers.
I tried these two snippets (see below), and either way, infinite scrolling is only enabled for one column/container.
add_theme_support( 'infinite-scroll', array(
'type' => 'scroll',
'container' => 'content',
'footer' => false,
) );
add_theme_support( 'infinite-scroll', array(
'type' => 'scroll',
'container' => 'highlights',
'footer' => false,
) );
and
add_theme_support( 'infinite-scroll', array(
'type' => 'click',
'container' => array( 'content', 'highlights' ),
'footer' => false,
) );
What am I doing wrong?
NOTE: If the fact that installing Jetpack requires a wordpress.com account is holding you back, please try Slim Jetpack. It even works on a local install of WP, and doesn’t require a wp.com account.