Title: PHP Question (Setting Excerpt Length)
Last modified: August 19, 2016

---

# PHP Question (Setting Excerpt Length)

 *  [nickaster](https://wordpress.org/support/users/nickaster/)
 * (@nickaster)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/php-question-setting-excerpt-length/)
 * Hi there –
 * I see that I can set the default excerpt length in functions.php with a little
   fancy PHP code.
 * How can I set the length for a particular template? ie – I have one particular
   page that shows a bunch of post excerpts – I want to set the excerpt length to
   something different, but only for that page. Right now I just have this code:
 * `<?php the_excerpt(); ?>`
 * What can I add there to make it “50 words” ….
 * Thanks!

Viewing 1 replies (of 1 total)

 *  Moderator [Kathryn Presner](https://wordpress.org/support/users/zoonini/)
 * (@zoonini)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/php-question-setting-excerpt-length/#post-2025745)
 * Unfortunately the_excerpt() function has no parameters.
 * Reference: [http://codex.wordpress.org/Function_Reference/the_excerpt](http://codex.wordpress.org/Function_Reference/the_excerpt)
 * Here are some manual workarounds:
 * [http://stackoverflow.com/questions/4082662/multiple-excerpt-lengths-in-wordpress](http://stackoverflow.com/questions/4082662/multiple-excerpt-lengths-in-wordpress)
 * You could also search for a plug-in.

Viewing 1 replies (of 1 total)

The topic ‘PHP Question (Setting Excerpt Length)’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Kathryn Presner](https://wordpress.org/support/users/zoonini/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/php-question-setting-excerpt-length/#post-2025745)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
