Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #1046532

    Hi Enfold-team

    I looked through other threads like , your documentation and a lot of info on other sites, but I don’t find a solution.

    As in the thread mentioned above, I’d like to add Amazon tracking code to the footer. I tried adding it to my child theme functions.php.

    But no matter what I insert, it’ll crash the site and give the error “Parse error: syntax error, unexpected ‘}’, expecting end of file in /www/htdocs/w011980a/wp-content/themes/enfold-child/functions.php on line 5” or similar ones.

    I entered this code according to your documentation:

    function add_amazon_associates_code_in_footer(){
    <script src=”//”></script>
    add_action(‘wp_footer’, ‘add_amazon_associates_code_in_footer’);

    Alternatively, I could add this asynchrous code which is recommended:

    <div id=”amzn-assoc-ad-6938ec11-aacc-472c-a644-XXXXXXXXX”></div><script async src=”//”></script>

    I’d appreciate your help on this.
    Thank you in advance


    Hey Aniona,

    If its a script link as opposed to a script code, you could just put that into the footer.php or header.php file directly.
    Best regards,
    Jordan Shannon


    Hi Jordan

    Thank you. I didn’t feel comfortable writing code into the footer.php (in the main theme, I use a child theme), so I added the code as a footer widget.
    This seems to work fine.

    Thanks and best regards



    Glad we could help!

    Please take a moment to review our theme and show your support
    Don’t forget to bookmark Enfold Documentation for future reference.

    Thank you for using Enfold :)

    Best regards,

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Add script code to footer’ is closed to new replies.