We developed Hasty for you! And we want to improve Hasty for you! So give us feedback and report bugs, so we can make Hasty even better.
Use this tool to register and enqueue custom scripts on your WordPress site with wp_enqueue_script() function.
Hint: Don’t forget to save the snippet to reuse it later.
Firstly you want to select a name for the snippet, to find it in Hasty for later use.
After you finished that, name your function. Please make sure, that the function name is unique, to prevent errors within your project. Also select where to hook the custom scripts.
Now it’s time to select your custom scripts. Select a unique name for your script, and define the path. It’s recommended to select a URL path relative to your theme. This can safe you tons of time if your theme path has to be changed later on. Make sure to write down the dependency, if there are any other scripts that need to be loaded to make your custom script work. A script version can be defined optionally. This is recommended to be flexible when cache busting is necessary. If the version isn’t defined, the currently installed WordPress version number will be applied. Last but not least select when to load the scripts. Some scripts need to be loaded last to make sure that all necessary DOM elements are available and other DOM elements wont be blocked by your running scripts.
Feel free to add more scripts to your queue by hitting the plus sign. Don’t forget to save your snippet (PRO only), so you can revise it and add more scripts later on.