Shortening Excerpt or Content

Shortening Excerpt or Content

Cut the excerptSometimes, our web will looks bad, because the content that shown at the main page were too long. Even you are change that content into excerpt “the_exceprt()” it will still too long, and still looks bad. The idea is you only need to show 100 Characters only, is this possible?

Actually, WordPress already have built in script to do this trick. To show only certain of character of our content. Lets see this example below :

How to Shortening the_excerpt

<?php echo substr(get_the_excerpt(),0,100); ?>

Descriptions :
- 0 : Start
- 100 : Ends
that sample above means, script will only show text from 0 until 100 chars. Its possible to show from 100th chars until 150 chars.
it will be like this
echo substr(get_the_excerpt(),110,150);

 

Got the point? Share it for everyone. If you need to know how to cut your title post, you can read it here.

Facebook comments:

Leave a Reply

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


five + one =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

AutoBlog Theme located at Indonesia , Malang, East Java . Reviewed by 98 customers rated: 4.4 / 5