Created
September 19, 2016 15:16
-
-
Save isaumya/f31123cba63341281c22f3f5017343a7 to your computer and use it in GitHub Desktop.
Count the total number of paragraph on any WordPress blog post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function __check_paragraph_count_blog( $content ) { | |
global $post; | |
if ( $post->post_type == 'post' ) { | |
$count = substr_count( $content, '</p>' ); | |
return $count; | |
} else { | |
return 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice !