Way to show content of a post, but if exceeds character limit revert to excerpt?
replace the_content(); with echo wpse_limit_content(); function wpse_limit_content() { $content = $post->post_content; $MAX_LENGTH = 100; if ( strlen( $content ) <= $MAX_LENGTH ) return apply_filters(‘the_content’, $content ); $s2 = substr( $content, 0, $MAX_LENGTH ); $s3 = preg_split( “/\s+(?=\S*+$)/”, $s2 ); $s4 = $s3[0]; return apply_filters( ‘the_excerpt’, $s4 ); } If the string is to long it … Read more