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' );
This entry was posted in Code snippets, Tips & Tricks and tagged , , . Bookmark the permalink.
  • Recent Comments

    Franck PARIENTI on Hook of the Month: taking cont…
    Jeremy on Hook of the Month: taking cont…
    Pam Huggins on Hook of the Month: taking cont…
    Scott Winterroth on Hook of the Month: taking cont…
    tomdryan on Hook of the Month: taking cont…
  • Archives

  • Enter your email address to follow this blog and receive notifications of new posts by email.

  • Install Jetpack to see our line-up of features.

    Install Jetpack Now

    Don’t need all Jetpack’s features? No problem. Only activate what you need!

    Follow

    Get every new post delivered to your Inbox.

    Join 56,413 other followers

    %d bloggers like this: