WordPress.org

Forums

[resolved] the_excerpt() (8 posts)

  1. bondweb
    Member
    Posted 2 years ago #

    I want change excerpt text value, for diplay less strings in abstract's articles, how can I do?

    Thanks for attention

  2. patv
    Member
    Posted 2 years ago #

    You can redefine the length of the_excerpt() with the following filter:

    function custom_excerpt_length( $length ) {
    	return 60;
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length');

    source

  3. bondweb
    Member
    Posted 2 years ago #

    Is this function in function.php?

  4. patv
    Member
    Posted 2 years ago #

    please refer to the codex. it's located in wp-includes/post-template.php.

  5. Is this function in function.php?

    no;

    you need to add the code into functions.php of your theme.

  6. bondweb
    Member
    Posted 2 years ago #

    Thanks you so much!!!!

  7. patv
    Member
    Posted 2 years ago #

    Oops, yes in the functions.php. misread :)

  8. bondweb
    Member
    Posted 2 years ago #

    I put it in pos-template and work very well :-)

Topic Closed

This topic has been closed to new replies.

About this Topic