• portia79

    (@portia79)


    Hi, I’m new to Understrap and WP. I’m trying to add some js.

    I understand that inc/enqueue.php loads the standard js files (jquery, etc.). If I would like to add my own js code, would I just add eg. script.js to src/js/ or js/? Which one? Then, I’d need to include it in enqueue.php

    I assume I’d need to modify gulpfile as well, am I right?

Viewing 2 replies - 1 through 2 (of 2 total)
  • understrap

    (@holger1411)

    Hi!

    Follow the discussion here:
    https://github.com/understrap/understrap/issues/602

    There are different ways. You can enqueue a new JS file from your enqueue.php or you can add more files to the minified theme.js by editing the gulpfile.js

    In a fututre release we will add a blank JS file to the build script where you can add your own JS without editing any core file.

    There is already a solution in the not-yet-released 0.8.2 version available here:
    https://github.com/understrap/understrap

    (just hit the big green “clone or download” button).
    It comes with an blank js file in /src/js/custom-javascript.js witch is already incorporated into the gulpfile.js build process

    Thread Starter portia79

    (@portia79)

    Thanks a lot.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘add custom js to understrap’ is closed to new replies.