Customizing get_the_excerpt() to specific length and “Read More” output.

To get a specific length you can use: wp_trim_words function. It has 3 parameters.

  1. Text to trim. Ex: get_the_content()
  2. Number of words. Ex: 295
  3. What to append after end of the text. Ex: '' This means null.

Use this:

<span>
    <?php echo wp_trim_words( get_the_content(), 295, '' ); ?>
    <i><a style="color:#1975D1;float:Right;" class="title" href="https://wordpress.stackexchange.com/questions/75069/<?php
        the_permalink() ?>" rel="bookmark">Click for Story & Video</a></i>
    <br/>
</span>

Leave a Comment