Title: Multiple excerpt lengths?
Last modified: August 21, 2016

---

# Multiple excerpt lengths?

 *  Resolved [isagoras](https://wordpress.org/support/users/isagoras/)
 * (@isagoras)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/multiple-excerpt-lengths/)
 * Hello
 * I have done as recommended and added this code to my functions.php:
 *     ```
       function custom_excerpt_length( $length ) {
       	return 50;
       }
       add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
       ```
   
 * This works perfectly, but I would like to have a different excerpt length elsewhere
   on the site.
 * Thanks – and great plugin. I like the minimal formatting – allowing me to style
   it how I like 🙂
 * [https://wordpress.org/plugins/display-posts-shortcode/](https://wordpress.org/plugins/display-posts-shortcode/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Bill Erickson](https://wordpress.org/support/users/billerickson/)
 * (@billerickson)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/multiple-excerpt-lengths/#post-5068708)
 * You can use conditional tags in that function. Ex:
 *     ```
       function custom_excerpt_length( $length ) {
   
       	if ( is_home() )
       		$length = 50;
       	else
       		$length = 30;
   
       	return $length;
   
       }
       ```
   
 *  [SmileWP](https://wordpress.org/support/users/anotheropus/)
 * (@anotheropus)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/multiple-excerpt-lengths/#post-5068814)
 * Hey Bill,
 * Thank you for this plugin.
 * Is there a way to control excerpt length individually inside each short code 
   instead of using PHP and global settings?
 * [display-posts excerpt-length=”130″]
 * I dislike loading up my functions.php as no developer updates my functions.php
   the way they do their plugin updates.
 * Thank you,
 * Chris
 * BTW I’d donate or pay for an advanced version of this plugin where all the stacks
   of functions listed in the pages on:
 * [http://www.billerickson.net/code-tag/display-posts-shortcode/](http://www.billerickson.net/code-tag/display-posts-shortcode/)
 * …we’re options in the plugin settings.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Multiple excerpt lengths?’ is closed to new replies.

 * ![](https://ps.w.org/display-posts-shortcode/assets/icon-256x256.jpg?rev=2940963)
 * [Display Posts - Easy lists, grids, navigation, and more](https://wordpress.org/plugins/display-posts-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/display-posts-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/display-posts-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/display-posts-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/display-posts-shortcode/reviews/)

## Tags

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

 * 2 replies
 * 3 participants
 * Last reply from: [SmileWP](https://wordpress.org/support/users/anotheropus/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/multiple-excerpt-lengths/#post-5068814)
 * Status: resolved