Jump to content


This topic is now archived and is closed to further replies.


How to add JavaScript Code in the header

Recommended Posts


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

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

The answer to many issues can be found by searching in the forum before posting as someone else  may very well have had the same problem before you have.  Also, reading the documentation can help you gain a good understanding of how everything works. 


Please do not send me private messages. Occam's razor - The principle states "Keep things simple!"

Share this post

Link to post
Share on other sites

  • Similar Content

    • Michael Kummer
      By Michael Kummer+
      Hi guys!
      I am using a plugin called Speed Booster Pack to speed up the load time of michaelkummer.com. One of the plugin settings, Minimize HTML and JavaScript causes an error that I only get with Pagelines. With other themes, such as WordPress' Twenty Seventeen, I do not get that error.
      I have reproduced the problem on my staging site and if you look at the JavaScript console, you will see the following error:
      SyntaxError: Unexpected end of script
      Any clue what PageLines may be doing differently to be contributing to this issue? I contacted the plugin developer and they, of course, pointed me to the theme developer
    • flourishdesignstudio
      By flourishdesignstudio+
      We are working on a site and the customers are complaining that the site loads too slowly. They contacted their host who mentioned that the Java Script is all loading at the beginning. Is it possible to delay the load of the less important Java Script until after the initial load to speed up the site? The goal is to load the page faster by minimizing the initial javascript calls.
      Are there any preferred plugins that you would recommend or does this end up causing excessive problems with plugins, etc.?
      Thanks for the help!
    • chamois_blanc
      By chamois_blanc+
      I am trying to clone a container on a page. It throws the following javascript error:
      function l(b, c, e, f) { var g = m.a.f.get(b, p); if (!c) { if (g) throw Error("You cannot apply bindings multiple times to the same element."); m.a.f.set(b, p, !0) } I would appreciate guidance and a fix. Thank you
    • Jeremiah
      By Jeremiah+
      Error: editing.js?ver=930684:5 Uncaught TypeError: Cannot read property 'getData' of undefined
      I have all of the plugins disabled and I still receive the error.
      Page Editor will not load on page.
    • oseehys
      By oseehys+
      Can someone give me a breakthrough out here?
      I have been on the media player for like 5 hours now yet it is still not displaying on my media box or the textbox,
      its a free media player on soundclound
      Great day ahead to the developers out here...
      am trying to install the Toneden media player https://www.toneden.io/player to display my songs on sound cloud, i followed everything on the doc, but obviuosly am missing something i did everything i can for 5 hours yet no breakthrough, am using the textbox as display.
      This is the html script i used, what am i missing here? see it below
        (function() { var script = document.createElement('script') script.type = 'text/javascript'; script.async = true; script.src = 'http://sd.toneden.io/production/toneden.loader.js' var entry = document.getElementsByTagName('script')[0]; entry.parentNode.insertBefore(script, entry); }()); ToneDenReady = window.ToneDenReady || []; ToneDenReady.push(function() { ToneDen.player.create({''enter code here'' dom: '#player', urls: [''https://soundcloud.com/reginaspektor'' ] }); });