WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Hit Counter (6 posts)

  1. aprilia
    Member
    Posted 9 years ago #

    Hi - I am new to bot WordPress and HTML. I am up and running and am trying to add a hit counter to my blog. I have the StatCounter code, but it assumes that I have a regular "index.htm(l)" root file.

    My questions: Where is the code for my home page using word press? What is the filename I need to add the content to?

    Thanks.

  2. Kafkaesqui

    Posted 9 years ago #

    What version of WordPress are you using?

    If 1.2.x, look at the index.php in your blog's root directory.

    If 1.5, look in your current theme's directory (wp-content/themes/), but which file to add it to depends partly on if the stat counter is displayed, and where you want to display it.

    In either case, your WordPress PHP files/templates are basically HTML files that allow you to embed PHP code. So for that part of the task, entering the code they've given you should not be a problem.

  3. aprilia
    Member
    Posted 9 years ago #

    I am using 1.5...sorry about that. All of the free hit counters state that I must place their code between the <body> & </body> tags. I downloaded the theme at http://chris.coggburn.us/cleanbreeze/ but that shouldn't matter, right? Heh-I just can't find the file with the body tags. Again, new to WP & HTML

  4. Lorelle
    Member
    Posted 9 years ago #

    Typically, the "body" tags are in the index.php within the wp-content/themes/yourthemechoice/ folder.

    I recommend if you are going to use one of these free hit counters you put it at the very bottom of your page, usually below the footer.

    Also, I found that when using these free hit counters, several nasty things happened. Now it might have been a coincidence that my over sexed email spam started arriving by the gross, unwanted in my email, but who is to really know. What I do know is that my page loading slowed down a lot. If that isn't important, who cares, but I believe that there are some free and worry-free hit counters as plugins. Check out the http://codex.wordpress.org/Plugins/ page to see what is available. Since these tend to work directly with your site and not from something offsite, they are usually fast and more accurate.

    And honestly, these can be fun, but most people know they can be faked and are gimmicky, often cluttering up a page. It's up to you how you use it, just my opinion. It took me a while to get over them. The site statistics were more important to ME than my viewers.

  5. Aprila, make sure that you're using the "W3C Compliant" code and place it in footer.php right after the sentence or last word and before <div id="footer"> closes. I've been using StatCounter without any problems for the past 3 months.

  6. Zly
    Member
    Posted 9 years ago #

    After weeks of BBClone vs WordPress 1.5 frustration I ran into this post. I put the StatCounter "W3C Compliant" code in foother.php and it works like a charm! Thanks! Syl

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.