Title: [Plugin: Network Latest Posts] Excerpt length
Last modified: August 20, 2016

---

# [Plugin: Network Latest Posts] Excerpt length

 *  Resolved [uros_m](https://wordpress.org/support/users/uros_m/)
 * (@uros_m)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-network-latest-posts-excerpt-length/)
 * I can limit the excerpt length by words but how can I limit it by chars? If I
   input a bare number it limits it to words although I think I saw somewhere that
   a bare number should limit by character.
 * So, how to limit the excerpt length by character count?
 * Cheers,
 * Uroš
 * [http://wordpress.org/extend/plugins/network-latest-posts/](http://wordpress.org/extend/plugins/network-latest-posts/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Jose Luis SAYAGO](https://wordpress.org/support/users/iluminatus/)
 * (@iluminatus)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-network-latest-posts-excerpt-length/#post-3121977)
 * Hi,
 * If you want to limit by chars you have to replace the _nlp\_custom\_excerpt_ 
   function from the file network-latest-posts.php on line 885 by this one:
 *     ```
       function nlp_custom_excerpt($count, $content, $permalink, $excerpt_trail){
           if($count == 0 || $count == 'null') { $count = 55; }
           /* Strip shortcodes
            * Due to an incompatibility issue between Visual Composer
            * and WordPress strip_shortcodes hook, I'm stripping
            * shortcodes using regex. (27-09-2012)
            *
            * $content = strip_tags(strip_shortcodes($content));
            *
            * replaced by
            *
            * $content = preg_replace("/\[(.*?)\]/i", '', $content);
            * $content = strip_tags($content);
            */
           $content = preg_replace("/\[(.*?)\]/i", '', $content);
           $content = strip_tags($content);
           // Limit the number of characters
           $content = substr($content, 0, $count);
           $content = $content . '...';
           // Add the trail
           switch( $excerpt_trail ) {
               // Text
               case 'text':
                   $content = $content.'<a href="'.$permalink.'">'._('more').'</a>';
                   break;
               // Image
               case 'image':
                   $content = $content.'<a href="'.$permalink.'"><img src="'.plugins_url('/img/excerpt_trail.png', __FILE__) .'" alt="'._('more').'" title="'._('more').'" /></a>';
                   break;
               // Text by default
               default:
                   $content = $content.'<a href="'.$permalink.'">'._('more').'</a>';
                   break;
           }
           // Return the excerpt
           return $content;
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Network Latest Posts] Excerpt length’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/network-latest-posts_61c601.svg)
 * [Network Latest Posts](https://wordpress.org/plugins/network-latest-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/network-latest-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/network-latest-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/network-latest-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/network-latest-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/network-latest-posts/reviews/)

## Tags

 * [characters](https://wordpress.org/support/topic-tag/characters/)
 * [excerpt](https://wordpress.org/support/topic-tag/excerpt/)
 * [length](https://wordpress.org/support/topic-tag/length/)

 * 1 reply
 * 2 participants
 * Last reply from: [Jose Luis SAYAGO](https://wordpress.org/support/users/iluminatus/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-network-latest-posts-excerpt-length/#post-3121977)
 * Status: resolved