WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] If no written excerpt (3 posts)

  1. boon_
    Member
    Posted 5 years ago #

    I'm trying to create an if statement which will only call the_excerpt if one has been written by the user (so not the WP generated on which ends [...])

    I am using this code...

    <?php if (get_the_excerpt($post->ID)!==''): ?>
    <?php the_excerpt(); ?>
    <?php endif; ?>

    But it's still called. I presume because WP still recognises the excerpt not equal to ' ' because it's generated one itself.

    Is there a way to qualify only an excerpt written by the USER?

    Thanks

  2. MichaelH
    Member
    Posted 5 years ago #

    What about $post->post_excerpt?

  3. boon_
    Member
    Posted 5 years ago #

    Thanks, seems to have done the trick.

    Used

    <?php if ($post->post_excerpt!==''): ?>
    <?php the_excerpt(); ?>
    <?php endif; ?>

    I love this community :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags