• 0

How to add JavaScript Code in the header


Question

Posted · Report post

Dear Pageline,

 

I tried to add below attached JavaScript code in the custom header section but it shows problem loading error. But when we check on the website fiskaz.com it shows the output but when I am trying to edit it shows problem loading. Previously Martin updated the same issue but I dont know how to remove those codes from the header. Could you please let me know how to remove those code so that in future if it happens so we can remove those codes. Also please let me know how to add that kind of JavaScript code in the header section.

 

Please look at the same ASAP.

Share this post


Link to post
Share on other sites

1 answer to this question

  • 0

Posted · Report post

Hello Fiskaz

 

Good to hear the Dev team got to the bottom of the problem for you. 

 

You can remove any custom code from your site in cases such as this by going to your WordPress admin page and to the menu item 'PageLines'

 

Wordpress Admin > PageLines > Fallback 

 

In the Fallback you will see the custom scripts and CSS code entered on your site and from here you can amend or remove the code as necessary. 

 

Adding javascript to WordPress sites is handled in the theme files and the method can be seen here https://codex.wordpress.org/Using_Javascript

 

We do not recommend changing any core files as we cannot support changes made to these files. so you are advised to do this by adding the code to a Child theme. this protects the core files and also your code as it would be overwritten by any update to DMS. 

 

Adding the code to a DMS Child theme is explained in detail here http://docs.pagelines.com/customize/base-child-theme

 

The best Child theme in my opinion is the bare bones child theme created by my colleague Danny and can be downloaded from his GitHub page here https://github.com/Dannyholt/Skeleton

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now