Giter Club home page Giter Club logo

Comments (9)

OmniaAgency avatar OmniaAgency commented on September 13, 2024

Luke,

You can place your own javascript files anywhere in the theme and then enqueue them in assets/functions/enqueue-scripts.php.

from jointswp.

scarfeyTIC avatar scarfeyTIC commented on September 13, 2024

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.

JeremyEnglert avatar JeremyEnglert commented on September 13, 2024

@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.

JeremyEnglert avatar JeremyEnglert commented on September 13, 2024

@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.

scarfeyTIC avatar scarfeyTIC commented on September 13, 2024

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:

http://wyp.pixeltester.net/

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.

JeremyEnglert avatar JeremyEnglert commented on September 13, 2024

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.

lukexiki avatar lukexiki commented on September 13, 2024

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.

scarfeyTIC avatar scarfeyTIC commented on September 13, 2024

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.

JeremyEnglert avatar JeremyEnglert commented on September 13, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.