Created
November 30, 2012 03:26
-
-
Save AdamWagner/4173595 to your computer and use it in GitHub Desktop.
Get the word count of a 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
/* | |
Word count | |
*/ | |
function wcount(){ | |
ob_start(); | |
the_content(); | |
$content = ob_get_clean(); | |
return sizeof(explode(" ", $content)); | |
} |
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
/* | |
Word count | |
*/ | |
function wcount(){ | |
ob_start(); | |
the_content(); | |
$content = ob_get_clean(); | |
return sizeof(explode(" ", $content)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment