Customize or Modify the WordPress Post Excerpt
How can I change the length of the excerpt?
A short description may be slightly longer or shorter depending on the post. If the post excerpt is used in post lists, it makes sense to adjust content length of the excerpt. In this case we can use the WordPress filter
To do this, add the following code snippet to the functions.php of your WordPress theme:
How can I extend or customize the excerpt?
If you want to append a suffix to the post excerpt, for example, we can use the WordPress filter
excerpt_more. This is useful if we want to end our post excerpt with a suffix like “…” or we want to insert a “Read more” button at the end of the text.
For example, add the following code snippet to your theme’s functions.php file, to append the shortened post excerpt with “…”:
Or use the following code snippets to include a read more button:
With these two WordPress filters, the post excerpt can be easily customized and extended.