scriptygoddess RSS Feed
 
 
 
 

Show full post if there is no excerpt

As the title said - needed to show the excerpt if there was one, or the *full* post if there wasn't (not the shortened version wordpress "fakes")

remove_filter('get_the_excerpt', 'wp_trim_excerpt');
if (get_the_excerpt() == "") {
echo apply_filters('the_content',get_the_content());
} else {
echo apply_filters('the_content',get_the_excerpt());
echo '<p><a href="'.get_permalink().'">Read more...</a></p>';
}

Updated 8/11/08 Made some changes to the code. Excerpts were coming in unformatted, also removed some extra stuff I don't think I needed in there…

4 Responses to “Show full post if there is no excerpt”

  1. 1
    Apoorv Khatreja:

    I really need this feature. How do I implement this code in my WP blog?

    And I would also like to know how to get the "Subscribe without commenting" box you have below your posts.

  2. 2
    Jennifer:

    Replace the code above where you would normally put your excerpt (look at your theme files - it can go anywhere you have the excerpt tag)

    As for the subscribe box - that's all part of this plugin:
    http://txfx.net/code/wordpress/subscribe-to-comments/

  3. 3
    Jennifer:

    *rather USE THE CODE above to replace where your excerpt tag. :)

  4. 4
    Khaleel:

    This would suffice
    //
    add_filter('get_the_excerpt', 'custom_trim_excerpt');
    //

Leave a Reply

Bookmarks

WordPress Resources

Meta

Random Stuff