diff --git a/kit/css/search.css b/kit/css/search.css index b935ad2..29ad849 100644 --- a/kit/css/search.css +++ b/kit/css/search.css @@ -135,3 +135,7 @@ h2.screen-reader-text { .tx-indexedsearch-res p { margin: 0.2rem 0; } + +.search-term { + background-color: yellow; +} diff --git a/kit/functions.php b/kit/functions.php index ef7425e..f9fd8f8 100644 --- a/kit/functions.php +++ b/kit/functions.php @@ -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', '\0', $text); - } - return $text; -} -add_filter('the_excerpt', 'highlight_results'); -add_filter('the_title', 'highlight_results'); diff --git a/kit/search.php b/kit/search.php index c13e2ef..92f74c1 100644 --- a/kit/search.php +++ b/kit/search.php @@ -51,8 +51,9 @@ get_header(); found_posts - $wp_query->post_count); - echo "Anzeige der Ergebnisse " . $post_start . " bis " . $wp_query->post_count . " von insgesamt " . $wp_query->found_posts. ""; + $post_count_start = (($paged -1) * 10) + 1; + $post_count_end = ((($paged -1) * 10) + $wp_query->post_count); + echo "Anzeige der Ergebnisse " . $post_count_start . " bis " . $post_count_end . " von insgesamt " . $wp_query->found_posts. ""; ?>