Forums

Determine if user has input an excerpt (2 posts)

  1. marinated
    Member
    Posted 2 years ago #

    Hello all, I understand that WP makes a "fake" excerpt if one has not been input by the user. I have a fairly basic and seemingly simple question;

    I need to be able to surround that "fake" excerpt with a <div id="blah">the_excerpt</div> block of code. If the user has input a "real" excerpt, it should not have the <div id="blah"> surrounding it, it should simply be the_excerpt (div-less)...

    I hope this makes sense, and that it is possible!

    Thank you for any help.

  2. marinated
    Member
    Posted 2 years ago #

    A hacked mashup I think, but it works :)

    If anyone has a more streamlined solution I'd be very thankful.

    if ($post->post_excerpt == "") {
        echo '<div id="blah">';
        the_excerpt();
        echo '</div>';
    }
    else {
        the_excerpt();
    }

Topic Closed

This topic has been closed to new replies.

About this Topic