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

    Goodmorning,

    I want to add a script from cookiebot in the header via funtions php but I get an error code every time I try.

    Can you help me adding this code?

    <script id=”Cookiebot” src=”https://consent.cookiebot.com/uc.js&#8221; data-cbid=”c0b4bd7c-2476-4827-bd09-50f952e1a7be” data-blockingmode=”auto” type=”text/javascript”></script>

    Thanks!

    #1199502

    Hey Dijkhuis,

    Can you try adding this code at the bottom of your child theme’s functions.php:

    function custom_script_name(){
    ?>
    <script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="c0b4bd7c-2476-4827-bd09-50f952e1a7be" data-blockingmode="auto" type="text/javascript"></script>
    <?php
    }
    add_action('wp_head', 'custom_script_name');

    Best regards,
    Nikko

    #1199636

    Hi Nikko, thank you but it is not working:. syntax error, unexpected ‘?’
    Is it possible for you to log in and try and make it work?
    I tried several things but unfortunately can not fix it.

    #1199693

    Hi Dijkhuis,

    I’m getting this when I try to check the link you gave:

    This site can’t be reached
    eerselsmooistewebdesign.nl’s server IP address could not be found.

    Can you put all the code in your child theme’s functions.php (including the code I gave) to https://pastebin.com/ and post the link here.

    Best regards,
    Nikko

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