Jump to content


Photo
- - - - -

How to add JavaScript Code in the header

JavaScript

  • Please log in to reply
1 reply to this topic

#1 Fiskaz

Fiskaz

    Advanced Member

  • Members

  • 42 posts
  • LocationMumbai
  • Framework Version:DMS 2
  • Country: Country Flag

Posted 08 April 2014 - 08:25 AM

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.



#2 greenfly

greenfly

    Advocate

  • Members

  • 3268 posts
  • LocationManchester, England
  • Framework Version:latest
  • Country: Country Flag

Posted 08 April 2014 - 12:37 PM

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.wordpr...sing_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.pageline...ase-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







Also tagged with one or more of these keywords: JavaScript