JavaScript to Header brakes cornerstone

Hello
I want to add a javascript to Header
I read the forums and I added the code to my child theme’s functions.php file
The script works great but broke cornerstone and its not loading. I remove script and cornerstone works again.

This is the code I added to functions.php file:
/Add script on the of the site/
add_action( ‘wp_head’, ‘add_head_script’ );
function add_head_script() { ?>

<?php } What an I doing wrong? Thank you in advance for your help.

Hi There,

The PHP code is fine, there may be conflict issue with the javascript you have added.
As we don’t know what JS code you have added so can’t confirm the cause of the issue.

can you please provide us your website details and the script that you have added so that we can look on to it.

Please provide following information:
Set it as Secure Note

  • Link to your site
  • WordPress Admin username / password
  • Script
    All the best!
1 Like

The javascript code added to to my child theme’s functions.php file

Hi @indie

I’ve tried to add a new page, then editing it with Cornerstone and I can see it’s working fine, please check “Testing Cornerstone” page I’ve created.

I believe this issue happens only on those already published pages? I can also see this warning in the browser console log:

The script itself isn’t being loaded in Chrome, it also might be incompatible with WordPress in first place, I recommend reaching out to the script author regarding this issue.

Thanks.

1 Like

Thank you for your help, I will look into this.
You are very fast and helpful!

No problem, you are welcome :slight_smile:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.