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…
August 3rd, 2008 at 2:34 am
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.
August 4th, 2008 at 8:51 am
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/
August 4th, 2008 at 8:52 am
*rather USE THE CODE above to replace where your excerpt tag.
August 7th, 2008 at 1:06 pm
This would suffice
//
add_filter('get_the_excerpt', 'custom_trim_excerpt');
//
May 31st, 2009 at 7:11 pm
isnt there a plugin that does this?