I'm trying to shorten the excerpt but it does not work. It shows the full excerpt which I write in the post edit!
I've added this to the functions.php
function custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
To show the excerpt I'm using in content.php:
if(has_excerpt()) { the_excerpt(); } else { the_content(); }
The above code display full excerpt, not shortened!
Without has_excerpt()
if statement
it displays correctly.
Where can be the problem? Any ideas what can cause this?
)
forif
statement?