WordPress and StatCounter
-
Does any of you know how to add a counter to a WP board? I would like to add a StatCounter to mt website, is it compatible or not?
Cheers!
-
All you have to do is take the HTML code that they provide and paste it an the exact spot you want in index.php. Just as if you were adding the counter to any normal page.
I tried both the invisible normal code and the invisible XHTML compliant code. I’d use the invisible normal code (don’t forget to ad a / just before the img tag closes).
I know there are some other WP user who use StatCounter. Which code do you guys use?What the hell is missing with this code??
<!– Start of StatCounter Code –>
<script type=”text/javascript” language=”javascript”>
<!–
var sc_project=474591;
var sc_partition=2;
var sc_invisible=1;
//–>
</script>
<script type=”text/javascript” language=”javascript” src=”http://www.statcounter.com/counter/frames.js”></script><noscript><img src=”http://c3.statcounter.com/counter.php?sc_project=474591&java=0&invisible=1″ alt=”site stats” border=”0″> </noscript>
<!– End of StatCounter Code –>
It should be W3 and frames compliant, but whenever I paste it into the index.php, wherever I put it, it will fcuk up my webpage. I’m using Kubric 1.2.6 as template.
Any help will be appreciated
http://www.domenicofeliciani.commacmanx you were speaking about closing the img tag with a ‘/’. What does it mean? … :'( Sorry guys about my newbieness!
Dom, look in index.php for your login link. Add
right behind it, and then your counter code behind that. As for the slash, just add it before the img tag closes, just like this:<img src="http://c3.statcounter.com/counter.php?sc_project=474591&amp;java=0&amp;invisible=1" alt="site stats" border="0"/>Actually, hang on a sec, I’ll get it for you.
Thannk a lot for your help macmanx. Really appreciate it. Tried everything with your code…doesn’t wanna work! :'(
Hm, hang on. I’ll give it one more shot.
Ok, open up index.php and look for:
- <h2><?php _e('Admin'); ?></h2>
- /wp-login.php"><?php _e('Login'); ?>
- <h2><?php _e('Admin'); ?></h2>
Now, replace that with:
<!– Start of StatCounter Code –>
<script type="text/javascript" language="javascript">
var sc_project=474591;
var sc_partition=2;
var sc_invisible=1;
</script>
<script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><img src="http://c3.statcounter.com/counter.php?sc_project=474591&java=0&invisible=1" alt="free web tracker" border="0"/> </noscript>
<!-- End of StatCounter Code -->
.No way, it doesn’t work. Looks like as soon as I try to edit the index.php, no matter how little the edit is, the page won’t load correctly. >:(
Thanks a lot for your help macmanx.
Try these ?
http://www.shinystat.com/
http://nextgenstats.com/Yayy!!…Shhh, we make it to work, don’t disturb it anymore, just leave that bloody StatCounter code alone….Thanks a lot for you help, again!
Yayy!!…Shhh, we make it to work, don’t disturb it anymore, just leave that bloody StatCounter code alone….Thanks a lot for you help, again!
Hm, I’m assuming that you got it to work right. ^_^ Excellent, glad I could help.
The topic ‘WordPress and StatCounter’ is closed to new replies.