WordPress.org

Ready to get started?Download WordPress

Forums

Hide empty excerpt (6 posts)

  1. fabioassis
    Member
    Posted 10 years ago #

    What may I do to hide the excerpt if it's empty?
    My (cleaned) code looks like this:

    <?php if ($posts) { foreach ($posts as $post) { start_wp(); ?>
    <?php the_title(); ?>
    <?php the_excerpt(); ?>
    <?php the_content(); ?>

    Now, WP repeats the content.

  2. perfectionisboring
    Member
    Posted 10 years ago #

    I ran into the same problem today, so I hope someone can help both of us with this problem. I am working on a music review site where I put the cd image in the excerpt, but for posts without an image (like site news) it repeats the content twice since the excerpt was left blank.

  3. sunshine
    Member
    Posted 10 years ago #

  4. mike
    Member
    Posted 10 years ago #

    Indeed. Coincidence.

  5. sunshine
    Member
    Posted 10 years ago #

    Uh, I wasn't suggesting that it wasn't.

  6. fabioassis
    Member
    Posted 10 years ago #

    Tks, guys!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags