• I’m using a child theme of the Thematic theme and I’m trying to add to my functions.php file a javascript link formatted like so:
    <script language=javascript src="https://example.com/school.smjs?accountID=xx&siteID=1&queueID=1"></script>

    The domain where this file is hosted is different from the domain at which my site resides.

    I have so far been unsuccessful at figuring out how to add this function without breaking the page. Any help would be greatly appreciated. I’ve read the codex and other threads, but haven’t been able to figure it out.

    Thanks in advance to anyone who can help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Does that code basically need to be in the <head> section of your theme?
    This is for adding a favicon, but you can swap out that bit for your code, its just a hook for functions.php to add stuff to the head section

    https://voodoopress.com/2011/02/add-a-favicon-to-your-theme-with-a-simple-hook/

    //ADDS FAVICON TO HEADER
    function voodoo_favicon() { ?>
        <link rel="shortcut icon" href="<?php echo bloginfo('stylesheet_directory') ?>/images/favicon.ico" type="image/x-icon" />
        <link rel="icon" href="<?php echo bloginfo('stylesheet_directory') ?>/images/favicon.ico" type="image/x-icon" />
    <?php }
    add_action('wp_head', 'voodoo_favicon');
    Thread Starter jzahlaway

    (@jzahlaway)

    Far as I can, that method doesn’t work. It appears the javascript needs to be called using a specific function rather than feeding it in via a simple “echo.” Not sure why.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add off-site javascript link via functions.php’ is closed to new replies.