scriptygoddess RSS Feed
 
 
 
 

Archive for July, 2008

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 [...]

Bookmarks

WordPress Resources

Meta