Word Count

I miss my old blog‘s word count feature, so I’m working on a way to bring it back in WordPress.

It looks like the TD Word Count plugin did the trick. The one problem with it is that it’s really only designed to generate stats that are visible on the author dashboard. I added a little “stats” group to my sidebar with the following code so that I could make some of the info public.

It looks like I’m currently at 103,181 words in 547 posts (not including this one).

<?php
    $tdwordcount_data = get_option('tdwordcount_data');
?>
<table width="100%">
<tr>
    <td>Posts: </td><td align="right"><?php print(number_format($tdwordcount_data['numposts_pub'])); ?></td>
</tr>
<tr>
    <td>Words: </td><td align="right"><?php print(number_format($tdwordcount_data['numwords_pub'])); ?></td>
</tr>
</table>

Leave a Reply