• i ‘ m using this code for displaying total word count of post in wordpress admin and this code is working fine but
    problem is that this code is showing total word of only english language post and this code is not working for hindi language articles.

    This Code is not showing Total words Count of Hindi Post. Please tell me how i solve this problem.

    // Add WordPress WordCount Column
    add_filter('manage_posts_columns', 'crunchify_add_wordcount_column');
    function crunchify_add_wordcount_column($crunchify_columns) {
        $crunchify_columns['crunchify_wordcount'] = 'Word Count';
        return $crunchify_columns;
    }
     
    // Show WordCount in Admin Panel
    add_action('manage_posts_custom_column',  'crunchify_show_wordcount');
    function crunchify_show_wordcount($name) 
    {
        global $post;
        switch ($name) 
    	{
            case 'crunchify_wordcount':
                $crunchify_wordcount = crunchify_post_wordcount($post->ID);
                echo $crunchify_wordcount;
        }
    }
     
    // Get individual post word count
    function crunchify_post_wordcount($post_id) {
        $crunchify_post_content = get_post_field( 'post_content', $post_id );
        $crunchify_final_wordcount = str_word_count( strip_tags( strip_shortcodes($crunchify_post_content) ) );
        return $crunchify_final_wordcount;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Total words Count Display Code’ is closed to new replies.