WordPress.org

Forums

Question about the Excerpt tag (4 posts)

  1. Mark
    Member
    Posted 9 years ago #

    Currently I am using "<?php ($post->post_excerpt) ? the_excerpt() : the_content(); ?>" in my WP theme. I have some posts that don't have excerpts so WP is using my content for that particular post instead of using "nothing" for the excerpt.

    Is there a way to tell WP that if I don't have an excerpt for a post that it will know NOT to post the content?

    Thanks guys/gals:)

  2. MichaelH
    Member
    Posted 9 years ago #

    Well it seems this plugin from Kaf might help you do what you want:
    http://guff.szub.net/the-excerpt-reloaded

  3. Kafkaesqui

    Posted 9 years ago #

    Or modify your bit of PHP to:

    <?php if(!empty($post->post_excerpt)) the_excerpt(); ?>

    This will only display an excerpt if something exists in the excerpt field of a post.

    (Not that I'm arguing against my own plugin, but sometimes it's overkill...)

  4. Mark
    Member
    Posted 9 years ago #

    Wonderful fellas! Thanks again:) Yeah a plugin might be a bit more than what I need and the "<?php if(!empty($post->post_excerpt)) the_excerpt(); ?>" works great!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags