How to change the default word length of summary of the function the_excerpt() in WordPress

The WordPress summary function the_excerpt() default display number of words can be modified as the following:

function custom_excerpt_length( $length ) {
return 200;//200 Is the number of words you want to display
}
add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 );

Related Article
What all junior WordPress developers should know

Anyone calling themselves a junior WordPress developer should know HTML and CSS, some basic PHP, and how WordPress works. That’s Read more

Get HD cover images of youtube videos in various sizes

How to get the url of Youtube video cover image: Just copy the cover image address below, and then replace Read more

Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’

Cannot connect to Mysql through /tmp/mysql.sock. The reason is that this socket does not exist. Two versions of mysql are Read more

Add “click to load more articles” function implementation method for WordPress theme

We should often see that many websites do not use the paging function, but "click to load more articles" to Read more

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-spam image