By default the_excerpt function used in WordPress uses 55 words but you can adjust it manually by adding text directly to Excerpt field which you can see under each post/page when editing it. Any text you add there will be used as excerpt for blog no matter how short or long it will be.
Other option is to implement excerpt filter via Child Theme functions.php which would look something like this:
I have been playing around with this for a little while now and have constructed the following .php file for the child theme but seem to be getting something wrong. I get the error that:
Name Description
sparkling-child Stylesheet is missing.
/* =Theme customization starts here
-------------------------------------------------------------- */
<?php //Opening PHP tag
// Custom Function to Include
function custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
?> //Closing PHP tag
I’ve created the style.css file separately now and the child theme is working fine, however the php file doesn’t seem to affecting any change in the post length.
I’ve also tried the excerpt field separately, but that doesn’t do anything either.
Ok, excellent, figured it out and it’s working just fine. only problem is that the image has gone from the home page now. Is there any way to keep the image there?
Otherwise excerpt doesn’t allow any html styling and content. Other option is to use default full content display and use <!–more–> tag like this theme was originally designed to be used.