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
- Where and how to put inline js in pages
- deregister scripts on certain page
- How to enqueue every script in a folder automatically?
- wp_register_script not loading as expected
- Dequeue Scripts and Style for Mobile not working?
- Run Product Filter Javascript On Page Template
- Defer all js except certain ones in functions.php file
- Search user metadata with checkboxes via ajax (almost working)
- jquery won’t load in footer
- If is multiple page templates
- 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?
- 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?
- 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
- 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?
- Including a specific Javascript Script in a template. Is my code correct?
- How do I remove the date and category form my portfolio pages
- Attempt to change jQuery version caused White Screen of Death
- jQuery does not work
- 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
- 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
- video.js not enqueueing?
- 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]
- Creating multiple category drop down
- Creating a custom wordpress widget and stopping js from running twice(once in active widget once in widget selector)?
- 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 use wp_enqueue_script properly?
- Get webpack to work on child theme
- How to load a css file depending on the current role
- localize_script but data changes dependent on product ID
- Add custom css file after plugin css with WordPress Child Theme functions.php
- Running javascript without hooking wp_head
- wp enqueue style on about us page
- Test CDN link from function.php or wp_enqueue_script/style?
- How to add javascript code into Divi child theme?
- Changing the default view of “The Events Calendar” for mobile
- Unable to declare AOS library in functions
- How To Display Author Popup on Entry Meta (Genesis Framework)?
- Help wiht adding fullcalendar.io to a WordPress page
- WP Enqueue Script Error
- Get child-pages slugs of current page into js-file
- Some code is added automatically to my site’s header – what is it?
- Javascript and Stylesheet in child page
- Automatic add space if user enters number(any digit)
- WordPress Jquery+scripts enqueue issue
- Why are some custom javascript files working but some are not
- WordPress Javascript Widget jQuery Dependency Issue
- Exclude javascript in certain page url and all following url’s after forward slash
- using enqueue_script in a shortcode isn’t working
- Using array page name together with page id to deregister script
- How do I get my nav menu to show sub pages?
- Why wp_ajax hooks doesn’t work?
- Remove snippets of JS from core
- Why my wp_enqueue_script doesnt work on some page?
- comment_post function with js not running
- Get all users from role and add to dropdown (select) – wordpress, javascript
- Auto updating JavaScript dependancy in functions.php
- WordPress enque the same script causes the setInterval not to work
- iOS and ajaxComplete
- wp_script_add_data not working