WordPress.org

Ready to get started?Download WordPress

Forums

THE_EXCERPT() Function Truncates At First Paragraph (2 posts)

  1. ncracraf
    Member
    Posted 3 years ago #

    I want to modify the number of words when I call the_excerpt() function. There are a ton of examples out there for how to do this; however, I'm not able to get any of them to work. No matter what solution I try, or what number I set the word count to be, the function always returns the first paragraph (unless the first paragraph has more than 55 words and then it truncates and appends the standard ellipses).

    For example, without any hacks and just calling the_excerpt() function, the following post...

    "Now is the time for all good men to come to the aid of their country.<paragraph>

    Four score and seven years ago…"

    ...would return "Now is the time for all good men to come to the aid of their country." even though this is far less than 55 words.

    I'm using 3.0.1 although I'm not sure if this matters. Has anyone else experienced this issue and, if so, found a solution?

  2. ncracraf
    Member
    Posted 3 years ago #

    I forgot to note that I don't manually enter any excerpts - I just let the_excerpt() function pull from the post automatically.

Topic Closed

This topic has been closed to new replies.

About this Topic