scriptygoddess

05 Jun, 2004

Optionally show excerpt

Posted by: Jennifer In: WordPress: Lessons Learned

There may be another way to do this, but I wanted to show the excerpt, but only if I had actually typed something in. Just doing the following, will show part of the post if there's no excerpt (maybe I was doing it wrong?):

<?php the_excerpt(); ?>

In any case, I use the "excerpt" field for "Guest author" information. So I have it only display when there IS guest author information by doing the following:

<?php if ($post->post_excerpt != "" ) {
echo "<p><b>".$post->post_excerpt."</b></p>";
}
?>

Related posts:

  1. Striping IMG tags from the_content in WordPress (and how to fudge page excerpts) Background: For a site I was working on, I was...
  2. Playing with Post Attachments I've been doing a ton of sites recently using WordPress...

Related posts brought to you by Yet Another Related Posts Plugin.

No Responses to "Optionally show excerpt"

Comments are closed.

Featured Sponsors


  • jerey: how do i rewrite this because it tried RewriteEngine on #Options +FollowSymlinks RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FIL
  • Jennifer: So I was testing this out to see if maybe something changed in the latest version - I had a test wordpress setup - and just dumped the mycomment funct
  • KDesign: Hi, thanks for the tutorial. I'm having problems though that I can't seem to find an answer to on the web. When I follow the example in the Codex h

About


Advertisements