Add Infinite Scroll to search result pages

Note: This snippet is no longer needed as Jetpack includes Search Pages by default now.

By default, Infinite Scroll is only active on your site’s home page as well as on the archive pages. You can, however, use the infinite_scroll_archive_supported filter to add support to other pages:

function tweakjp_custom_is_support() {
	$supported = current_theme_supports( 'infinite-scroll' ) && ( is_home() || is_archive() || is_search() );
	
	return $supported;
}
add_filter( 'infinite_scroll_archive_supported', 'tweakjp_custom_is_support' );
Posted in Code snippets, Tips & Tricks | Tagged , , | Comments Off on Add Infinite Scroll to search result pages

Enable Infinite Scroll in your theme using Masonry

To enable Infinite Scroll in your theme, you can follow the steps described here. However, if your theme uses the Masonry library you’ll need a few extra steps. Luckily, WPTheming put together a great tutorial:
Jetpack Infinite Scroll + Masonry

Posted in Code snippets, Tips & Tricks | Tagged , , , | Comments Off on Enable Infinite Scroll in your theme using Masonry

How to change the credit link in the Infinite Scroll footer

If you’d like to change the default credit link appearing in the Infinite Scroll footer, you can use the infinite_scroll_credit filter, like so:

function tweakjp_cust_credit() {
	return '<a href="http://example.com">My Custom Link</a>';
}
add_filter( 'infinite_scroll_credit', 'tweakjp_cust_credit' );

Once you add that code to your theme’s functions.php, a new link will appear instead of the default “Powered by WordPress” link.

Posted in Code snippets, Tips & Tricks | Tagged , , | Comments Off on How to change the credit link in the Infinite Scroll footer
  • Enter your email address to follow this blog and receive news and updates from Jetpack!

    Join 111,669 other subscribers
  • Browse by Topic