I have been running into an issue with WordPress that I’d like some help with. As you know if you use WordPress, there is a WordPress plugin that allows you to track your blog stats. However, I have run across SEVERAL themes that, if I use them as my blog’s theme, seem to BLOCK visitors from being tracked on this stats page. In other words…people are visiting my blog, but with some themes active, the traffic won’t register on WordPress Stats. With other themes active, they DO register. Any idea what might be in some themes that blocks the stats, and how to fix it?
I came across this question being asked by Craig from Videogame Vagabond on a message board I frequent and thought I’d echo my answer here, as I’m sure this problem has been experienced by many a WordPress user. Here’s the bottom line:
The problem is caused by missing bits in the WordPress theme. As a plugin author I find it very frustrating when people complain that plugins aren’t working correctly, I investigate, and find that theme authors have omitted certain sections that should be there!
In this case, the stats tracking code is embedded in the footer of the website, which means that the plugin assumes you have a line reading:
<?php wp_footer(); ?>
in the footer file of your template.
If you’re missing this tag, any plugin that needs it won’t work and this includes the WordPress stats plugin. The solution is to add the line to the footer file of your template, and contact the template author to let him know he’s been a “very naughty boy“.
Unfortunately this problem is more common than you may think and it may cause people to abandon plugins or themes that don’t work well together. Resolving the issue is not hard, if you know what hooks the plugin is using and what tags are needed in the WordPress theme. Wading through code can be a daunting prospect for the uninitiated though. (someone once compared it to trying to use one of these adjustable beds without a manual) so if you have a specific issue, just Ask a Question and I’ll help you out!