WordPress - Custom excerpt length

function custom_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'custom_excerpt_length' );
By default the WordPress excerpt length is set to 55 characters, this function allows you to specify your own excerpt length.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.