How to Customize WordPress Excerpt?Length

WordPress Excerpt displays a portion of the whole content. Usually, in the case of archive page, this excerpt is used to display a part instead of showing whole content. 

Need help in fixing WordPress issues or Customization, Contact Me

It is often needed to change the excerpt default length based on your needs. So, if you are feeling the need of setting a custom excerpt length for your website, this post will satisfy your query. 

We will use a filter hook named excerpt_length. It accepts a parameter that contains the length of the post. So, simply write the following codes in the theme’s functions.php file. 

WordPress Excerpt Lenght

Set your expected value to return like 30. As a result, now 30 words will be displayed. 

要查看或添加评论,请登录

MD Zakaria Islam的更多文章

社区洞察

其他会员也浏览了