INTRODUCE: Term Highlight
When active, Term Highlight will automatically scrub the Title and Excerpt returned from searches and wrap search terms with a span, allowing you to highlight them in such a way that matches your site design well.
Term Highlight also includes a function allowing you to retrieve an excerpt from the post_content or from a Custom Field that contains at least one of the search terms.
Installation for this Extension is the same as all other Extensions. Download the zip file from your Account, upload and install as you would any other WordPress plugin. Term Highlight will show up in your Plugins list in the WordPress administration area, and you can activate it.
Once activated, Term Highlight will automatically highlight terms within the Title and Excerpt for native WordPress searches. Highlights are applied by wrapping terms in , which you can target in your CSS.
Term Highlight will also automatically override calls to the_excerpt() by replacing that content with an excerpt that contains at least one search term from the main content (e.g. the main content field, not Custom Fields). It will also highlight terms in this content. If you would like to disable or customize this functionality, please see the filters below.
View the installation guide, browse the Knowledge Base, read the FAQ, find out about SearchWP’s many hooks, get support
- Highlighting Results:
When term highlighting is enabled on the Advanced tab of the SearchWP settings screen, search terms in the title and default excerpt of results will be wrapped in a mark tag with a class of searchwp-highlight
- Better excerpts:
By default, enabling this feature will not change excerpts, but highlighting will take place when a search term is found. SearchWP can retrieve a better excerpt that contains the submitted search term and in doing so override the default excerpt with something that has the highlighted term.This functionality takes into consideration Custom Fields and Shortcode output! It will also consider the post content itself much like native excerpt functionality if necessary.
- Supplemental Search Engines:
Term Highlight does not automatically highlight terms for Supplemental Search Engine searches! You will need to customize your template by sending your content through the highlighter before outputting it.
There are a number of hooks to customize the behavior of highlighting in SearchWP