Add Infinite Scroll to search result pages

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.

Comments are closed.

Follow

Get every new post delivered to your Inbox.

Join 58,150 other followers

%d bloggers like this: