get_the_excerpt() not returning anything when post has no excerpt

Double check that you don’t have a check for has_excerpt() that’s hiding the “auto-generated” excerpt. Even if get_the_excerpt() returns something made from post_content, has_excerpt() still returns false if the excerpt is empty.

If that’s not the case, see if there’s a function that filters on get_the_excerpt that could be effecting this.

To answer your question, wp_trim_excerpt(), the function that “fakes” an excerpt, filters get_the_content() which the_excerpt() is just a wrapper function for. So that’s not the issue.

Leave a Comment