Forums

the_excerpt show nothing if none (4 posts)

  1. twofivethreetwo
    Member
    Posted 3 years ago #

    At the moment the_excerpt will show first few lines of content if there is no excerpt, however I need the_excerpt to be blank if there is none, not display lines from the_content. I'm using it to display a thumbnail next to a post. However, not all have thumbnails yet, so I need it blank. How would I do this?

  2. Otto
    Tech Ninja
    Posted 3 years ago #

    Add this to your theme's functions.php file:
    remove_filter('get_the_excerpt', 'wp_trim_excerpt');

  3. twofivethreetwo
    Member
    Posted 3 years ago #

    That did it, thanks. However, now it is adding a <br / where the excerpt would be if there is none.

  4. coderb
    Member
    Posted 3 years ago #

    did you ever get rid of the inserted break? am having the same problem. thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags