I just found a solution to limiting the number of words in the excerpt without plugins. Add the following code to your functions.php file. Use this function if you’re planning on using it more than once with a different amount of characters. Displays the excerpt of the current post after applying several filters to it including auto-p formatting which turns double line-breaks into HTML paragraphs. It uses get_the_excerpt() to first generate a trimmed-down version of the full post content should there not be an explicit excerpt for the post.

Custom Excerpt Limit WordPress

Custom Content Limit WordPress

If you want to limit your excerpt to 25 words the code would look like this:

Another way to display limited excerpt by character. Here is the functions.php file code.

After this you need to add where you want to display your customized character by character.

Published by S M Hasibul Islam

I am S M Hasibul Islam (Bachelor of Computer Science & Engineering), a web programmer with more than 5 years experience as like skill php, mysql, html5, css3, javascript, jquery, wordpress, responsive web design, hosting managements with VPS, shared server, also web UI, SEO, SMM.

Leave a comment

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

 

New to site? Create an Account


Login

Lost Password?

Already have an account? Login


Signup

Hotel Booking in BangladeshBCS Preparation Online Website Design Company in BangladeshHigh Risk Solutions Merchant Account Services