Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Last active August 27, 2017 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchristopher/8356313 to your computer and use it in GitHub Desktop.
Save jchristopher/8356313 to your computer and use it in GitHub Desktop.
Customize the number of words used when SearchWP's Term Highlight extension builds an excerpt containing at least one search term
<?php
function my_searchwp_th_num_words() {
// use 75 words instead of the default 55
return 75;
}
add_filter( 'searchwp_th_num_words', 'my_searchwp_th_num_words' );
@justlevine
Copy link

Is it me, or is this filter no longer working in the latest versions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment