Create multiple excerpt lengths for different needs in WordPress

Sometimes we need custom excerpt length in our custom WordPress website for each excerpt, for example in sidebars, widgets, archives etc. In these situtation this small snippet can come handy.

echo wp_trim_words( get_the_content(), 20, '...' );
Need a helping hand in fixing your website issues?

If you are facing any problems in implementing these code snippets and tutorials, you can hire us to fix your website issues.

Hire Us