WordPress.org

Support

Support » Themes and Templates » Boilerplate » [Resolved] excerpts with different lengths?

[Resolved] excerpts with different lengths?

  • I’ve used boilerplate_excerpt_length to change the default length. How can i create and excerpt with an alternative length for different pages?

Viewing 2 replies - 1 through 2 (of 2 total)
  • This article might be useful for what you’re looking for: Multiple excerpt lengths.

    The code will vary depending on what you are trying to achieve.

    Theme Author Aaron T. Grogg

    @aarontgrogg

    That function, which can be found starting line 259 of the function.php file, has a built-in default of 40, but you can pass any length in that you want:

    function boilerplate_excerpt_length( $length ) {
    	return 40;
    }

    So, you can use any method of determining which page you are on in your post/page templates, then simply pass that length value to the boilerplate_excerpt_length function.

    Hope this helps,
    Atg

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] excerpts with different lengths?’ is closed to new replies.
Skip to toolbar