Character Counter WordPress
-
I am using this function in my function.php theme page.
function bac_post_word_count(){
global $post;
//Variable: Additional characters which will be considered as a ‘word’
$char_list = ”; /** MODIFY IF YOU LIKE. Add characters inside the single quotes. **/
//$char_list = ‘0123456789’; /** If you want to count numbers as ‘words’ **/
//$char_list = ‘&@’; /** If you want count certain symbols as ‘words’ **/
echo str_word_count(strip_tags($post->post_content), 0, $char_list);}
Then i add this to show where i want in single.php or index.php
<?php if(function_exists(‘bac_post_word_count’)) { bac_post_word_count(); }?>
But this just count the words not spaces, numeric, symbols etc….
I want to count every type of characters, spaces, dots, commas, even everything please help me…
- The topic ‘Character Counter WordPress’ is closed to new replies.