Home>Support>How to put the code in to Vantage theme

How to put the code in to Vantage theme

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

Hey,
I have signed up for Aweber to add a newsletter form to my website. As part of the installation I need to add the following code to my site:

(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = “//forms.aweber.com/form/83/1926195111.js”;
fjs.parentNode.insertBefore(js, fjs);
}(document, “script”, “aweber-wjs-59oiivt7a”));

I should add the code somewhere between the body-tags. I have done the same thing on other themes, and then it has worked. But in the Vantage theme, nothing happens. I have created a child theme, but I have tried both adding the code to the parent theme and create a new file and added that to the childtheme.

The file I have altered is header.php. This has been the file in other themes. Any suggestions on how to proceed?

Thanks in advance!

// Anders

URL: http://casinofakturan.se

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 10 years, 10 months ago Andrew Misplon
    Hi, I Work Here

    Hi Anders

    Best not to add it to the child theme as those changes will be lost during any theme updates.

    Did you add a script wrapper when inserting between the body tags?

    <script>
    (function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "//forms.aweber.com/form/83/1926195111.js";
    fjs.parentNode.insertBefore(js, fjs);
    }(document, "script", "aweber-wjs-59oiivt7a"));
    </script>
    

    That might be the problem.

    If you’d like to insert this into the header or footer then the easiest would be to use the following plugin:

    https://wordpress.org/plugins/header-and-footer-scripts/

  2. 10 years, 10 months ago Anders Bergman

    Sorry, there seems like some of the code had been lost in the copying: Here is the entire code i put in:

    (function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = “//forms.aweber.com/form/83/1926195283.js”;
    fjs.parentNode.insertBefore(js, fjs);
    }(document, “script”, “aweber-wjs-n3youtenj”));

    So the scrip-div is there. I’ve tried both the child theme and the other, but nothing happened.

  3. 10 years, 10 months ago Anders Bergman

    Damn it, the same thing happened again, but now I’m sure the this site choose not to show it.

     <div class="AW-Form-1926195283"></div>
    <script type="text/javascript">(function(d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) return;
        js = d.createElement(s); js.id = id;
        js.src = "//forms.aweber.com/form/83/1926195283.js";
        fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "aweber-wjs-n3youtenj"));
    </script>
  4. 10 years, 10 months ago Andrew Misplon
    Hi, I Work Here

    Thanks. Perhaps try inserting into the header using:

    https://wordpress.org/plugins/header-and-footer-scripts/

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More