wordpress

how to add filter for wordpress?

excerpt length is set to 55 words. To change excerpt length using excerpt_length filter, add the following code to functions.php file in your theme:

function custom_excerpt_length( $length ) {
	return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
Advertisements