WordPress.org

Ready to get started?Download WordPress

Ideas

Adding parameter to the_excerpt()

  1. kardjo
    Member

    I want to have some parameter in the the_excerpt() tag like the_content_rss(), that limiting words count showed.

    In default, the_excerpt() is 55 words if no excerpt provided. But I want to customize this (let say only 20 words, exist or not exist the excerpt of content).

    thanks

    Posted: 5 years ago #
  2. Pete
    Member

    good idea... there are plugins that allow this, and more too

    Posted: 5 years ago #
  3. Ahmet Topal
    Member

    12345

    There is a very easy wasy to make this:
    open wp-includes/functions-formatting.php with an editor
    find the line:
    function wp_trim_excerpt($text) {

    and change
    function wp_trim_excerpt($text) {
    ...
    $excerpt_length = 55;
    ...

    with any you want (like 20, ...)
    Save it and upload it...

    OR HERE A PLUGIN FOR THAT: http://guff.szub.net/2005/02/26/the_excerpt-reloaded/

    Posted: 5 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    12345
    2 Votes
  • Status

    This is plugin territory