Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #600547

    hi, i want to add a widget snippet to my enfold theme?

    “This is your widget snippet. Copy-paste it into the code of the pages you want to chat on. Right before the </head> tag is the best option.”

    <!-- Chatra {literal} -->
    <script>
        ChatraID = 'RRRXdJSx7rcmqw';
        (function(d, w, c) {
            var n = d.getElementsByTagName('script')[0],
                s = d.createElement('script');
            w[c] = w[c] || function() {
                (w[c].q = w[c].q || []).push(arguments);
            };
            s.async = true;
            s.src = (d.location.protocol === 'https:' ? 'https:': 'http:')
                + '//call.chatra.io/chatra.js';
            n.parentNode.insertBefore(s, n);
        })(document, window, 'Chatra');
    </script>
    <!-- /Chatra {/literal} -->

    Where an how can i add this snippet into the site? i use an enfold child theme. can i add this to the footer.php (child)?? to which position in the code?

    thank you very much.

    #600573

    Hey diefleischerei!

    Yes, the best position is on the enfold-child.
    Please do let us know if you need anything else, we will be happy to assist.

    Regards,
    Basilis

    #600584

    And where? Can you please help me with the exact position :) Thank you Basilis.

    #601028

    Hi,

    Please try the following in your child themes function.php:

    function add_custom_code() { ?>
    <script>
        ChatraID = 'RRRXdJSx7rcmqw';
        (function(d, w, c) {
            var n = d.getElementsByTagName('script')[0],
                s = d.createElement('script');
            w[c] = w[c] || function() {
                (w[c].q = w[c].q || []).push(arguments);
            };
            s.async = true;
            s.src = (d.location.protocol === 'https:' ? 'https:': 'http:')
                + '//call.chatra.io/chatra.js';
            n.parentNode.insertBefore(s, n);
        })(document, window, 'Chatra');
    </script>
    <?php
    }
    add_action('wp_head', 'add_custom_code');

    Best regards,
    Rikard

    #601125

    Perfect. Thank you. CLOSED.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘widget snippet’ is closed to new replies.