hi, i’m trying to change the length of the excerpt, but the value entered with elementor is ignored.
I read other topics with the same problem, I tried to add the recommended codes but it’s not working, maybe I’m wrong.
I tried these:
add_action( 'after_setup_theme','tu_change_excerpt_length' );
function tu_change_excerpt_length() {
remove_filter( 'excerpt_length', 'generate_excerpt_length', 999 );
remove_filter( 'excerpt_length', 'generate_excerpt_length', 20 );
add_filter( 'excerpt_length', 'generate_excerpt_length', 15 );
}
add_action( 'after_setup_theme', 'tu_remove_blog_filters' );
function tu_remove_blog_filters() {
remove_filter( 'excerpt_length', 'generate_excerpt_length', 15 );
remove_filter( 'excerpt_more', 'generate_blog_excerpt_more', 15 );
remove_filter( 'the_content_more_link', 'generate_blog_content_more', 15 );
}
Thanks for your help