Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1020649

    What is the best way to edit the header when the Enfold plugin is active? Nothing I try seems to be working:

    I am having difficulties installing and verifying the HotJar integration as per instructions here.

    After realizing that “SOGO Add Script to Individual Pages Header Footer” is not able to have any impact in the header, I tried the following method:

    I modified the Function.php and added the following:

    function add_HJCode(){
    ?><script>
        (function(h,o,t,j,a,r){
            h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
            h._hjSettings={hjid:1047713,hjsv:6};
            a=o.getElementsByTagName('head')[0];
            r=o.createElement('script');r.async=1;
            r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
            a.appendChild(r);
        })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
    </script>
    
    <?php
    }
    add_action('wp_head', 'add_HJCode');
    

    But I am getting the following error message:

    Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP.

    • This topic was modified 6 years, 6 months ago by WPTim.
    #1020958

    Hey WPTim,

    Did you try to add the function using FTP instead then? I don’t see any problems with your function.

    Enfold is a theme by the way, not a plugin.

    Best regards,
    Rikard

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