Comments (9)
Luke,
You can place your own javascript files anywhere in the theme and then enqueue them in assets/functions/enqueue-scripts.php.
from jointswp.
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.
from jointswp.
@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.
from jointswp.
@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?
from jointswp.
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.
from jointswp.
Here is the JS file your theme is calling:
http://wyp.pixeltester.net/wp-content/themes/west-yorkshire-playhouse/assets/js/min/scripts.min.js?ver=4.2.2
It looks like you want to be calling this file instead:
http://wyp.pixeltester.net/wp-content/themes/west-yorkshire-playhouse/assets/js/min/scripts.js?ver=4.2.2
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.
from jointswp.
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
Luke
from jointswp.
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.
from jointswp.
The theme now calls the non-minified script by default.
However, I still highly recommend minifying your JS before launching a site.
from jointswp.
Related Issues (20)
- NPM Install issue HOT 1
- NPM Run Watch error - no CSS complied HOT 4
- Autoprefixer Not Working HOT 3
- Foundation 6.6 HOT 19
- Issues Compiling Sass??? Maybe? HOT 4
- How to edit menu items HOT 1
- Autoprefixer issue HOT 2
- Range Slider HOT 1
- Site Logo Won't Render HOT 2
- Discord.js installl error git checkout 11.3-dev HOT 1
- New build on MacOS 11.4 Big Sur throws errors HOT 3
- gulp-sass 5 error HOT 4
- What's the closest alternative? HOT 2
- Foundation is ALIVE! v6.7.1 released and counting. HOT 1
- SASS on M1 Mac HOT 3
- NPM Run Watch Fails - gulp-sass no longer has a default Sass compiler; please set one yourself HOT 1
- SCSS Compile Error
- Pagination not working in production (was working fine in dev) hosting=NetSol
- JointsWP won't install on Mac or Windows HOT 3
- gulpfile on node11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jointswp.