Skip to content

Instantly share code, notes, and snippets.

@ericlbarnes
Created December 22, 2014 15:03
Show Gist options
  • Select an option

  • Save ericlbarnes/a6406ba3359e2232c86d to your computer and use it in GitHub Desktop.

Select an option

Save ericlbarnes/a6406ba3359e2232c86d to your computer and use it in GitHub Desktop.

Revisions

  1. ericlbarnes created this gist Dec 22, 2014.
    14 changes: 14 additions & 0 deletions wordress-word-count.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    <?php
    $words = 0;

    $posts = query_posts([
    'posts_per_page' => -1,
    'year' => '2014',
    ]);

    foreach ($posts as $post) {
    $words += str_word_count($post->post_content);
    }

    echo 'Total Words: '. number_format($words);
    ?>