waynedunkley
2/19/2015 - 6:39 AM

Limit posts on search results page

Limit posts on search results page

function limit_posts_per_search_page() {
	if ( is_search() || is_author() )
		set_query_var('posts_per_archive_page', 3);
}
add_filter('pre_get_posts', 'limit_posts_per_search_page');