WP plugin: Category Word Count
- plugin:
- Category Word Count
- version:
- R1.1
- download:
- catcount.zip
- source:
- cat-word-count.php
In regards to my upcoming November writing project, I’ll be tracking word count for my story offline, but also wanted an automated running total in WordPress of all posts in the novel’s category (in other words, the novel). It was something I had in Movable Type last year through use of a plugin. There are several plugins and hacks for WordPress that provide word count on a per-post or site-wide basis, but nothing I found that worked specifically on categories.
So I wrote one. Naturally.
To use Category Word Count, download the zip file, extract cat-word-count.php from it, and drop that in your /wp-content/plugins folder.
Once it’s activated in WordPress, you can call it from your WordPress template using the cat_word_count() function. For example:
<?php cat_word_count(); ?>
Which returns something like:
Deep Thoughts word count: 4,560
It accepts two arguments; the first is the numerical id for a category (this defaults to the current category when on a category page), and the second is for the prefatory text (default is shown above):
<?php cat_word_count('2', 'A lot of words: '); ?>
And so, that’s one less thing for me to think about this November.
cat_word_count() or the URL query, all categories are counted. In other words, it then duplicates Nick Momrik’s most excellent Post Word Count plugin (Sorry Nick, it couldn’t be helped). That is all.
Author: Kaf Oseo
Categories: WordPress
Comments: (8) · Leave a comment · Comments RSS2
Guff is back! I kept checking every once in a while and found the note at guff.blogspot. I have to admit that I was discouraged, especially after the “server not found” error at burningbird. Now I can get back to my habit of waiting impatiently for hilarious and insightful entries. Excellent.
DSR moved to weblogger.com this summer. I put the new site in the link. I hope you’ll drop by.
I’m having trouble viewing the site with IE 5.2.3 on Mac 10.3.5. Other browsers work fine with it, though.
Hey Kevin! Good to see ya, too.
The snarkiness never left me, but it did fall into disuse online. Sorry ’bout that. I’ll hit DSR, especially once my search engine referrals start to shock me. And thanks for the new(er) link. Wasn’t sure where you guys went, even though I hadn’t really sought DSR out when I noticed the old url was dead. Bad me.
~drops it in misc-ish links~
Presently guff is aimed at the freshest baked goods out there, but I am working on a less-whizbang version to slab on the day olds, and to deal with accessibility issues. The blind need guff too, you know!
THANK YOU THANK YOU! I’m doing NaNoWriMo again this year and this is just what I wanted! =)
This is so wonderful, as a fellow NaNo-er I have to give you huge kudos and thanks :-) But…um, not to be overly picky but the word count seems to be off. Both Rough Draft and the NaNo counter have my WC at 1745 but the plugin has it at 1847. Is this a WP thing? I’d love to take credit for those extra 102 words but that’d be cheating :-)
I’m looking for a plugin that actually counts the words as I’m writing them. So, it gives me a constantly updating display, as to how many words I’ve written so far. Ever see one like that?
This plugin hasn’t worked for me since I upgraded to 2.5 :/. The plugin installs, but it tell’s me I’ve zero words in the target category (I’ve checked and wordpress hasn’t messed with the category names or anything).
Hi Kaf, I look for character count instead of word count. Is this possible with your plugin? I am on wp 2.6.2 Thx!