Site logo

[Support request] pasting scripts in either the header or the footer

Home Forums Support [Support request] pasting scripts in either the header or the footer

Home Forums Support pasting scripts in either the header or the footer

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1564898
    Christopher

    How can I paste scripts in either the header or the footer?

    #1564916
    Ying
    Staff
    Customer Support

    Hi Christopher ,

    Go to Dashboard > appearance > elements > add new element
    Choose hook and create.

    The hooks you are after would be wp_head & wp_footer.
    https://docs.generatepress.com/article/wp_head/
    https://docs.generatepress.com/article/wp_footer/

    Here’s an article on how to use hook element, it’ll be helpful.
    https://docs.generatepress.com/article/hooks-element-overview/

    #1566392
    Christopher

    Does this look right?

    add_action(wp_head);
    function header scripts() { ?> 
    <script>  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
    
      ga('create', 'UA-88195641-1', 'auto');
      ga('send', 'pageview');
    
    </script>
    <meta name="google-site-verification" content="--kwPHU7AAG6MYTB3OPHUD5o0kI19C_1mqmfI87vNQ0" 
    
    />
    <p>
    I help podcasters, trainers, and speakers produce and publish great spoken word audio 
    
    without spending hours on editing.
    <p>
    <img tabindex="-1" id="longdesc-return-55189" longdesc="https://wright-media.com?
    
    longdesc=55189&referrer=55188" src="https://www.wright-media.com/wp-
    
    content/uploads/2018/02/28000767_10156304987741155_977988228_n-300x300.jpg" 
    
    alt="Christopher's logo" width="300" height="300" class="aligncenter size-medium wp-image-
    
    55189" />
    
    <?php
    #1566410
    Leo
    Staff
    Customer Support
    #1566421
    Christopher

    That link doesn’t work.

    #1566443
    Leo
    Staff
    Customer Support

    Sorry – updated above.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.