WordPress.org

Ready to get started?Download WordPress

Forums

Change excerpt length in twenty ten theme (modified) (4 posts)

  1. matt-tyas
    Member
    Posted 2 years ago #

    Hi,

    I cannot work out how to get my excerpts to limit their character length in a theme I modified from twentyten.

    Here is the functions.php code: http://pastebin.com/7xTRJkYZ

    Here is the front end code for displaying one post in the loop-index.php file: http://pastebin.com/AQ3WYyC6

    I am total stumped as, the excerpt at present does not limit the length at all, you can put an essay in the excerpt input and it all displays.

    Thank you for your help.

    Matt

  2. keesiemeijer
    moderator
    Posted 2 years ago #

    Manual excerpts (the one you fill in on the edit Post screen) are shown in full. If a Post doesn't have a manual excerpt the post content will be shortened to 55 words and stripped of all HTML.
    http://codex.wordpress.org/Excerpt#Excerpt.2C_automatic_excerpt.2C_and_teaser

    Your code works on my testsite for automatic excerpts.

    Try one of these functions if you want it to affect the manual excerpts too:
    http://www.transformationpowertools.com/wordpress/automatically-shorten-manual-excerpt
    http://wordpress.org/support/topic/two-different-excerpt-lengths?replies=6

  3. matt-tyas
    Member
    Posted 2 years ago #

    Oh I see it is case of me not understanding the default functionality!
    I think I can solve my problem now.

    Thank you.

  4. keesiemeijer
    moderator
    Posted 2 years ago #

    No problem. It's all a bit confusing. Glad you got it resolved.

Topic Closed

This topic has been closed to new replies.

About this Topic