Add HTML, JavaScript or Google Analytics code to the footer of your WordPress site

It is not very complicated to add HTML, JavaScript or Google Analytics code to the footer of your WordPress site.

Open your theme’s functions.php file (if you don’t know where/what that is, you might be better off not doing this… or if you are persistent, google it first so you have an idea of what you are doing).

Somewhere after the <?php tag in that file, enter the following code:

function add_custom_footer_stuff() {
    ?>
    PUT YOUR HTML, JAVASCRIPT OR ANALYTICS CODE HERE!
    <?php
}
add_action('wp_footer', 'add_custom_footer_stuff');