How To: Fix WordPress.com Stats Plugin
Although I’ve fallen into the trap of ‘Stat Obsession’ a few too many times, I try not to view them that much as those numbers can either make or break my day depending on how the pretty little lines zig-zag.
One of the basic plugins I use on my blog is, WordPress.com Stats and although I do use several others, such as Google Analytics and others, WP.com stats is the first graph I see when I fire up the blog.
During some theme tweaking I had been doing on the blog here, I finished up cleaning up the footer to add in my links and site map then called it a day. I put out a couple of new posts that I had hoped would bring in some traffic, yet when I logged into the blog, my stats chart had been reading zero hits for the day. I didn’t think much of it as it was still early and I hadn’t performed any post promotion and shrugged it off.
After some light promotion and article submission work, I checked again a few hours later and still nothing came back with any new hits. I started to become a bit discouraged and checked my Google Analytics account and sure enough, the site was lit up with new hits; so why wasn’t my stats showing as such using the WordPress.com stats plugin?
After some poking around and digging back in to my footer code, I noticed that the wp-footer line was nowhere to be found. Surely, id’ I’m using plugins that are built for WordPress, I must have that line sitting somewhere. Luckily, as take this as a reminder, I backed up my footer file prior to making my changes and after comparing the two, my backup did indeed have the wp-footer line in place; but I had unintentionally removed it in my own changes. Whoops.
I figured I’d just verify my findings and after receiving the virtual b-slap from Google, sure enough, the plugin requires the missing line of code that I had removed. Once I added the line back in, the stats started to show up again.
So, if you’re having similar issues, make sure you have the following line of PHP code in your Footer.php: <?php wp_footer(); ?>
Now, if I can just figure out how to add in that line of code that will automatically brew my coffee in the mornings, I’m set!



04. Jul, 2010 






