Quantcast
Channel: Wordpress API - Developer Code Book » wp tutorials
Viewing all articles
Browse latest Browse all 10

display your posts words count in wordpress

$
0
0
http://wordpressapi.com/2011/03/19/display-posts-words-count-wordpress/

If you want to display the words count in your post. you should use the following code in functions.php file.

If you are not wordpress developer then dont use this code in your theme files.

function wcount(){
 ob_start();
 the_content();
 $content = ob_get_clean();
 return sizeof(explode(" ", $content));
}

 

In single.php file put following code for showing the word count.


echo wcount();

Source

Follow us on Twitter WordPress API


Viewing all articles
Browse latest Browse all 10

Trending Articles