Thanks Hans for your prompt reply.

I used this piece of code in the theme’s functions.php file

dd_filter( ‘excerpt_length’, function($length) {
return 40;
} );

but the number of words is still 20.