I'm using built-in WordPress search.php programs, can you really highlight the term looked on, in context using the search engine results retrieved?

For instance, basically entered "items", any page that came back this matching word could be outlined towards the user.

Thanks.

This is a function you can include to functions.php which will highlight the looked term within the results.

/* Search Highlighting ********************************************/
// This highlights search terms in both titles, excerpts and content

function search_excerpt_highlight() {
 $excerpt = get_the_excerpt();
 $keys = implode('|', explode(' ', get_search_query()));
 $excerpt = preg_replace('/(' . $keys .')/iu', '<strong class="search-highlight">\0</strong>', $excerpt);

 echo '<p>' . $excerpt . '</p>';
}


function search_title_highlight() {
 $title = get_the_title();
 $keys = implode('|', explode(' ', get_search_query()));
 $title = preg_replace('/(' . $keys .')/iu', '<strong class="search-highlight">\0</strong>', $title);

 echo $title;
}

To make use of this function it needs to be included to your archive loop:

<?php if (is_search() ) { 

    search_excerpt_highlight(); } ?>