Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #24626

    Armen T
    Participant

    I know that to add scripts in the Customizer you take out the <script> tags.

    How does that work when the code is like this:

    <script src="//static.getclicky.com/js" type="text/javascript"></script>
    <script type="text/javascript">try{ clicky.init(100718890); }catch(e){}</script>
    <noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/100718890ns.gif" /></p></noscript>
    #24991

    Kory
    Keymaster

    Hey Armen,

    Thanks for writing in! You will first need to setup a child theme then add the following code to the functions.php file of that theme:

    function my_custom_head_output() {
      ?>
        ...code here...
      <?php
    }
    
    add_action( 'wp_head', 'my_custom_head_output', 99999 );
    
    function my_custom_footer_output() {
      ?>
        ...code here...
      <?php
    }
    
    add_action( 'wp_footer', 'my_custom_footer_output', 99999 );

    You can replace the sections that say …code here… with the snippets of code provided to you. Depending on if you need it in the <head> or near the closing <body> tag, you’ll want to use one or the other above.

    Thanks!

    #25180

    Armen T
    Participant

    Top job, Kory.

    Many thanks again!

    #25226

    Rubin
    Keymaster

    You’re welcome!