Custom js inclusion

Hi, 

Is there a way to include custom js files similar to the custom.css into the theme? I'd like to include a few new functions in a separate file and then use custom js box in for initialization code only.

Comments

  • Hi,

    for that we created Theme options > Layout > Custom CSS & JS > Custom JS section where you can keep own js functions.
  • Yes, well I know that one. What I asked was if there was a way of including a js FILE instead of pasting it into the box. If I have 400 lines of js code that little box is not a great place to put it in. That box is good for init code as it ends up at the bottom of the document.

    You can use custom css by uploading a custom.css file - why is there no similar feature for js?
  • Everything is possible but you must know coding. But if you ask about file including, i guess that you are not familiar with coding and in this case you should contact with your website developer.
  • I know how to include a file. No need to be rude. I was asking if there is a way to include it from within the theme environment so as not to have to edit the template files and make updating there theme a hassle in the future.

    There is no hook for the document head so I am asking ig you've made it possible somewhere else.

    I'd take a simple "no" over the patronizing attitude thanks.
  • Who is rude? Because probably you are not talking about us :) However when someone is asking if this is possible, for us it means that he don't know how to do it. But if you are sure that you know how to do it then do it in functions/theme-head.php file. This file include all css and js files. But please remember that after modifications you won't be able to do theme updates.
Sign In or Register to comment.