Home » Labs » Custom excerpt length for WordPress site  

Custom excerpt length for WordPress site


Filed under Labs

You can set the limit to WordPress excerpt by adding following code to your functions.php file.It will overwrite the default limit with custom value defined in function.

 
<?php
 
	function custom_excerpt_length($length) {
		return 120;
	}
	add_filter('excerpt_length', 'custom_excerpt_length');
 
?>

Posts you may like: