instead of using get_template_directory_uri().'/assets/js/pre.js','1.0.0'
try using get_theme_file_uri('/assets/js/pre.js','1.0.0')
It worked for me, for some reason when use get_template_directory_uri()
you will get a 403 error
Related Posts:
- How to enqueue JavaScript for specific WordPress pages only?
- Enqueuing Script in functions.php vs on the page
- wp_is_mobile dequeue not working
- Why won’t my scripts load?
- how to en-queue jQuery to load before the tag
- Run a jquery script on on a certain template page
- Theme JS is available but theme CSS isn’t
- How to load jQuery in TOP of wp_footer?
- Include Jquery libraries in wordpress theme?
- wp_enqueue_script() not working
- custom post with loading script per single post
- java script error Uncaught SyntaxError: Unexpected token ILLEGAL
- dynamically import array from another js file in WordPress
- How to load scripts/styles specific for a page
- WordPress Enqueue for homepage only, functions.php, wp-framework
- Where and how to put inline js in pages
- deregister scripts on certain page
- Does WordPress Development Mode Exist (with not minified JS)?
- Enqueue Script with data attributes
- How to enqueue every script in a folder automatically?
- Apply jquery script to only woocommerce product pages and categories
- Most elegant way to enqueue scripts in function.php with foreach loop
- wp_register_script not loading as expected
- Problem using is_single() to enqueue script from functions.php
- Dequeue Scripts and Style for Mobile not working?
- Run Product Filter Javascript On Page Template
- Enqueue script o style only if a template part is loaded
- Defer all js except certain ones in functions.php file
- Dequeue script in template isn’t working
- Properly applying nonce to a form using AJAX
- Clean-up script tags
- Search user metadata with checkboxes via ajax (almost working)
- wp_enqueue JavaScript in child-theme (ReferenceError) using Search & Go
- Why is my Gutenberg block returning an error after initial save?
- jquery won’t load in footer
- If is multiple page templates
- How do I get a child theme to load scripts from the parent theme?
- How to properly add NPM packages and integrate them in WordPress?
- wp_enqueue_script add integrity parameter
- Passing arguments to my function with do_action and add_action is not working
- When using wp_enqueue_script(); in a theme why don’t we use add_action?
- Adding tawk.to code just before body tag on functions.php file
- How to filter a table in post content without plugins? [closed]
- Load JS Script only for custom post types
- Get Current User info using wp_localize_script, in functions.php
- How to get the post_name when in preview?
- Enqueue scripts not working with if is page conditional tag in functions.php
- Replace menu links with # and add name to its li
- Register vendor JS/CSS only on pages that require them?
- Loading CDN that requires jQuery in WordPress
- How to hide unused profile fields?
- wp_register_script(… $in_footer = true) not working
- Not sure if enqueuing js scripts properly
- Only let plugin add actions to wp_head & wp_footer on single posts
- Register and load scripts
- Scripts not appending to element in AJAX call – why?
- call of javascript function to external url always blocked by cors
- Including a specific Javascript Script in a template. Is my code correct?
- How to search using ajax for exact phrase or words in an input field?
- enqueue styles for only mobile wp
- Overwriting the menu break points of twentysixteen in child theme
- How do I remove the date and category form my portfolio pages
- I can’t enqueue my scripts – They literally aren’t being added to my site
- Attempt to change jQuery version caused White Screen of Death
- jQuery does not work
- enqueue_script with filemtime javascript not working
- Javascript function not working when placed in Text Block
- I have problems with loading javascripts
- add_action wp_enqueue_script priority level only works for admins
- Scripts not loading when using the wp_enqueue_scripts action
- Adding javascript to functions.php causes problems with my template
- Dequeue script to prevent javascript event conflict on wordpress child theme
- Why does get_template_directory_uri() not include “www”, only for enqueued stylesheets?
- In jquery use php variable to execute an enqueued jquery file
- javascript and css links not working on sever
- Enqueue script on every page except one
- wp_enqueue_script | Help me figure out what is causing jQuery is not defined
- Load JS file only in specific template
- Enable right click on WordPress site
- The correct way to add a JavaScript in the functions.php [closed]
- Javascript not loading after the document ready
- 404 when enqueue_script using plugin_url
- Auto scroll to id on page load on all pages except home page. Only do this on mobile
- Need help with customalert that it would read on a normal page, but not in WordPress
- video.js not enqueueing?
- Problem enqueuing scripts on not single posts
- Call two different function.js depending on page
- Linking Javascript in functions.php file
- Dequeue scripts in IE7 only using functions.php
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- Why I can’t load my JavaScripts using an hook inside my functions.php file?
- Creating multiple category drop down
- Creating a custom wordpress widget and stopping js from running twice(once in active widget once in widget selector)?
- Enqueueing scripts selectively & activation where needed
- How to setup a popup registeration page in wordpress with function.php
- Why is this function crashing my wordpress installation? [closed]
- colorbox not loading in
- Fatal error: allowed memory size when after using enqueue_script
- Custom attributes to javascript tags
- How to change text color depending on the number value (Using javascript)