Sorry this might be old post but I thought I would share. You can do this. First you need to have the search files in you theme folder, it is better behavior. Open the the results.php file and put the following function at the top:
x00Don't PM about development, I'm not currently taking on clientsMVP
If you re going to do it hat way, at least copy it over to you theme, otherwise it is likely to get overwiten. Better still do it is plugin with hooks. Or non invasive javascript, for optimal performance.
Don't PM about development, I'm not currently taking on clients.
Answers
Sorry this might be old post but I thought I would share. You can do this. First you need to have the search files in you theme folder, it is better behavior. Open the the results.php file and put the following function at the top:
function search_excerpt_highlight($excerpt, $keywords) { $keys = implode('|', explode(' ', $keywords)); $excerpt = preg_replace('/(' . $keys .')/iu', '<strong class="search-highlight">\0</strong>', $excerpt); return($excerpt); }Then replace this:
SliceString(Gdn_Format::Text($Row->Summary, FALSE), 250);by this:
Then you can use css to style the strong.search-highlight elements.
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •If you re going to do it hat way, at least copy it over to you theme, otherwise it is likely to get overwiten. Better still do it is plugin with hooks. Or non invasive javascript, for optimal performance.
Don't PM about development, I'm not currently taking on clients.
grep is your friend.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Yes definitely.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •