fix page results count

This commit is contained in:
Jonas Heinrich 2020-04-26 18:02:36 +02:00
parent 4fcd021cb7
commit 4c62fafeb9
3 changed files with 7 additions and 15 deletions

View file

@ -263,16 +263,3 @@ function kit_modify_posts_per_page( $query ) {
}
}
add_action( 'pre_get_posts', 'kit_modify_posts_per_page' );
function highlight_results($text) {
if (is_search() && !is_admin()) {
$sr = get_query_var('s');
$keys = explode(' ', $sr);
$keys = array_filter($keys);
$text = preg_replace('/('.implode('|', $keys) .')/iu', '<span class="search-highlight">\0</span>', $text);
}
return $text;
}
add_filter('the_excerpt', 'highlight_results');
add_filter('the_title', 'highlight_results');