Prolific for WordPress
Get the source (v1.0)
In action
If you look at the menu on my archives index you can see how I'm using it.
Installation and Implementation
- Place the prolific.phps file into your /wp-content/plugins/ directory.
- Change the file extension from ".phps" to ".php".
- Open the file in your favorite text editor, locate the $file variable, and set it to the absolute path of the file you want to use to hold the value of the word count.
- Activate the plugin from the WordPress admin panel; now, each time you publish a new post, the file will be updated with the new word count.
- To use this value in a web page, simply insert the following code where you want the number to appear; note that you are going to need to change the path so that it matches the path you specified above in step three.
<?php $file = '/path/to/your/file';
$fh = fopen($file, 'r') or die('could not open file!');
$data = fread($fh, filesize($file)) or die('could not read file!');
echo $data;
fclose($fh); ?>
Support
Hopefully you won't experience any problems, but feel free to e-mail me if you do.