How to set different excerpt length for different post types?

WordPress excerpt is an optional summary or short description of the post. You can use post excerpt to display post summary on archive pages and search page. You can use the_excerpt(); to display post excerpt. You might want to display post excerpt of different length for different post types based on the layout of displaying posts. You can use the function as below to define different post excerpt length for different post types.


Disclaimer: *This post may contain affiliate links. I may earn a small commission when you click on the links and buy the products with no additional cost to you. Thank you.

Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments