I have the following excerpt function in wordpress
add_filter( 'excerpt_more', 'wpdocs_excerpt_more' );
/**
* Filter the except length to 20 words.
*
* @param int $length Excerpt length.
*
* @return int (Maybe) modified excerpt length.
*/
function wpdocs_custom_excerpt_length( $length ) {
return 40;
}
add_filter( 'excerpt_length', 'wpdocs_custom_excerpt_length', 999 );
And I wonder if it is possible to have more than one excerpt function to use in different post. The purpose is to give different lengths to the posts that are shown depending where they are located