This Documentation is for SearchWP Version 3

Available since: 3.0


View Parameters »

When highlighting is enabled SearchWP can generate its own excerpts. This hook controls how many words are used to form those excerpts.

// When highlighting, tell SearchWP to generate excerpts that are 75 words long.
add_filter( 'searchwp_th_num_words', function( $length ) {
return 75;
} );
view raw functions.php hosted with ❤ by GitHub


Parameter Type Description
$length Integer

Length (in words) of generated excerpts