Forums

[resolved] How do I add a line of code to a sidebar or footer? (6 posts)

  1. rarefires
    Member
    Posted 7 months ago #

    Hello,

    I'm trying to install the simplest of hit counters on my site, http://www.ridgeblog.ca

    Here's the instructions I have:
    1. Upload simplehitcounter.php to the /wp-content/plugins/ directory.
    2. Activate the plugin through the 'Plugins' menu in WordPress.
    3. Place <?= simplehitcounter_hit(); ?> somewhere like the footer or sidebar.

    Steps 1 and 2 are simple. Step 3, I'm not sure how. Putting a line of code is not like dragging and dropping a widget in there.

    Can anyone help out?

    Thanks.

    - Greg

  2. govpatel
    Member
    Posted 7 months ago #

    You can that code in footer.php just after `wp_footer();
    ?>` before
    </body>

  3. rarefires
    Member
    Posted 7 months ago #

    Hi govpatel,

    my theme (Twenty Eleven) doesn't contain that line of code in footer.php

    Here is the entire footer.php - where would you put that piece of code for the plugin?

    [CSS moderated as per the Forum Rules. Please just post a link to your site.]

    Thank you..

  4. kletskater
    Member
    Posted 7 months ago #

    <?php wp_footer(); ?>
    ///think you place your line here!////
    </body>

  5. govpatel
    Member
    Posted 7 months ago #

    my theme (Twenty Eleven) doesn't contain that line of code in footer.php

    It is there

    <?php wp_footer(); ?>
    Your code here
    </body>
    </html>

  6. rarefires
    Member
    Posted 7 months ago #

    Thank you all... I found the right spot and it worked.

    http://www.ridgeblog.ca

    I think this kind of coding is called HTML... I am not really familiar with it. Can anyone recommend a good reference source to get me started on understanding the language?

    Thanks.

Reply

You must log in to post.

About this Topic