- This topic has 3 replies, 4 voices, and was last updated 1 year, 9 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
› Forums › WordPress/WooCommerce › How can I adjust the default length of an excerpt in WordPress?
Is there any plugin or we can do it manually to adjust the default length of an excerpt in WordPress?
In WordPress, you can adjust the default length of an excerpt by using a filter hook called excerpt_length. Here’s how you can do it:
function custom_excerpt_length( $length ) {
return 20; //change this number to your desired length
}
add_filter (‘excerpt_length’, ‘custom_excerpt_length’, 999);
How do I show an excerpt instead of the full post in WordPress?
Scrolling down, you can then select “Excerpt” in the “Post Content” section. You might also be able to enable post excerpts in these areas if your theme has a “Theme Settings” or “Post General Settings” option. Once you’ve finished, press the “Publish” option.