WordPress.org

Ready to get started?Download WordPress

Forums

Showing the excerpt only if there is an excerpt (1 post)

  1. jbickers
    Member
    Posted 6 years ago #

    OK, stupid noob question here, but I'd like to figure out the most elegant way to do this ...

    My site uses the excerpt field to associate an external URL with each post. At the end of the post, the reader gets a send-off to the source material, via the excerpt:

    <a href="<?php the_excerpt_rss(); ?>" target=_blank>Read the whole thing here.</a>

    Except now, we're beginning to do posts that don't go to an external link, and that means there won't be an excerpt. So what's the cleanest, neatest way to only display the above link if the excerpt has any content, and skip it if it is empty?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags