Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Better Post excerpts for WordPress
/**
 * Fancy excerpts
 * 
 * @link: http://wptheming.com/2015/01/excerpt-versus-content-for-archives/
 */
function the_fancy_excerpt() {
    global $post;
    if ( has_excerpt() ) :
        the_excerpt();
    elseif ( @strpos ( $post->post_content, '<!--more-->' ) ) :
        the_content();
    elseif ( str_word_count ( $post->post_content ) < 200 ) :
        the_content();
    else :
        the_excerpt();
    endif;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.