Available since: 3.0
searchwp_th_num_words
View Parameters »When highlighting is enabled SearchWP can generate its own excerpts. This hook controls how many words are used to form those excerpts.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// When highlighting, tell SearchWP to generate excerpts that are 75 words long. | |
add_filter( 'searchwp_th_num_words', function( $length ) { | |
return 75; | |
} ); |
Parameters
Parameter | Type | Description |
---|---|---|
$length |
Integer |
Length (in words) of generated excerpts |