-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Where the custom Javascript can be inserted? #86
Comments
Luke, You can place your own javascript files anywhere in the theme and then enqueue them in assets/functions/enqueue-scripts.php. |
I too seem to be having the same problem - I've even tried the above suggestion of setting my custom script to enqueue but nothing is working. |
@lukexiki, the theme enqueues from the minified JS file. If you're making changes in the non-minified file, be sure to enqueue that instead. Although you don't have to use Gulp, the new structure is setup to be used with Gulp. Any JS files you put into the assets/js/site folder will be concatenated and minified into the assets/js/min//scripts.min.js file. If you don't want to use Gulp/Grunt, just enqueue the non-minified file. |
@scarfeyTIC, if you aren't able to enqueue any scripts, it sounds like there may be a bigger issue. Do you have a link I can check out? |
Thanks for the reply Jeremy. I'm still trying to get my head around the new layout for the JS files so it's obviously something I'm doing wrong. I've been working on this tester site: I'm using codekit to compile the JS and I think it's outputting in the wrong way. I've been making my script edits in the script.js file outside of the min folder, presuming that it would minify into the script.min.js. At present I'm just trying to do a simple alert on document.ready to get the files working. |
Here is the JS file your theme is calling: It looks like you want to be calling this file instead: Go into your assets/functions/enqueue-scripts.php and check out line #20. Remove the .min from the file name and you should be good to go. I'll most likely update the theme to call the non-minified file by default. This should help cut back on the confusion. |
Hi, Thanks a lot for your replies. I have managed to make this work, all you need is to update enqueue-scripts.php to load the proper js you are working on and make sure that the custom code is before jQuery(document).foundation(); thanks a lot Jeremy and OmniaAgency regards |
Morning Jeremy. Thanks for looking in to this for me. For anybody else struggling with this the above suggestion from Jeremy works. Thanks for the help. |
The theme now calls the non-minified script by default. However, I still highly recommend minifying your JS before launching a site. |
Hi Jeremy,
Well done to the latest version of JointsWP, it's awesome!
One little thing, I'm a little lost as to where I go from here. Where can I insert my custom javascripts? Before I used to input these in Scripts.js in the section (// add all your scripts here). Now in the new version I tried to insert them in the scripts.js but it does not work. Since I'm a newbie, do you have a solution to my dilemma please?
Please let me know,
Thanks a lot,
Luke
The text was updated successfully, but these errors were encountered: