Count words for all posts by all authors

Question

So I got this code from another query and it works for one single post.

However, I want to show the total words of all the published posts by all authors. How do I modify this or is there a wp function that exists?

functions.php:

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

Template:

<?php echo prefix_wcount(); ?>

0
Elaine Byene 1 month 2022-10-28T00:37:48-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse