How to add multiple custom excerpt length in wordpress

In archive pages, we use the_excerpt() function to show excerpt of each posts. Be default, wordpress uses 55 words as excerpt if you don’t enter anything in Excerpt meta field. Now, if you want to change the length of excerpt, there is a filter available for that. excerpt_length is the filter that you can use to customize the excerpt length, just use it following way: [php] function new_excerpt_length($length) { return 20; } add_filter(‘excerpt_length’, ‘new_excerpt_length’); [/php] You can change 20 to some other integer. But what if you need to use multiple length of excerpt in different archive pages? We, in […]

Continue Reading

You may also like