First, be sure to enable WP_DEBUG
in your wp-config.php
file, so that you can see fatal error messages.
In this case, the problem is that you’ve named your function load_wforms()
, but you reference the callback wforms
in your add_action()
call:
function load_wforms() {}
…vs…
add_action('init', 'wforms');
The second parameter, wforms
, refers to a function named wforms()
– but your function is named load_wforms()
. Change your add_action to this:
add_action( 'init', 'load_wforms' );
(Side note: you should enqueue scripts at wp_enqueue_scripts
, rather than init
.)
Edit
Also: fix the syntax error as noted by @milo in his comment:
wp_register_script('wforms', get_stylesheet_directory_uri().'/js/wforms.js'), false, '2.0');
You have an extra parenthesis:
'/js/wforms.js')
…should be:
'/js/wforms.js'
Related Posts:
- How to load scripts/styles specific for a page
- WordPress Enqueue for homepage only, functions.php, wp-framework
- deregister scripts on certain page
- Enqueue Script with data attributes
- How to enqueue every script in a folder automatically?
- 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?
- Enqueuing External Javascript functions.php
- How to enqueue JavaScript for specific WordPress pages only?
- Enqueue script o style only if a template part is loaded
- Enqueuing Script in functions.php vs on the page
- Dequeue script in template isn’t working
- If is multiple page templates
- How do I get a child theme to load scripts from the parent theme?
- 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
- Enqueue scripts not working with if is page conditional tag in functions.php
- wp_is_mobile dequeue not working
- Register vendor JS/CSS only on pages that require them?
- Why won’t my scripts load?
- Not sure if enqueuing js scripts properly
- Only let plugin add actions to wp_head & wp_footer on single posts
- Register and load scripts
- enqueue styles for only mobile wp
- how to en-queue jQuery to load before the tag
- Attempt to change jQuery version caused White Screen of Death
- jQuery does not work
- enqueue_script with filemtime javascript not working
- add_action wp_enqueue_script priority level only works for admins
- Scripts not loading when using the wp_enqueue_scripts action
- Why does get_template_directory_uri() not include “www”, only for enqueued stylesheets?
- In jquery use php variable to execute an enqueued jquery file
- Enqueue script on every page except one
- Run a jquery script on on a certain template page
- wp_enqueue_script | Help me figure out what is causing jQuery is not defined
- Load JS file only in specific template
- Theme JS is available but theme CSS isn’t
- 404 when enqueue_script using plugin_url
- How to load jQuery in TOP of wp_footer?
- video.js not enqueueing?
- Include Jquery libraries in wordpress theme?
- Problem enqueuing scripts on not single posts
- Call two different function.js depending on page
- Why I can’t load my JavaScripts using an hook inside my functions.php file?
- Enqueueing scripts selectively & activation where needed
- colorbox not loading in
- Fatal error: allowed memory size when after using enqueue_script
- wp_enqueue_script() not working
- How to use wp_enqueue_script properly?
- Get webpack to work on child theme
- Advanced method to control cache of enqueued style/script
- How to load a css file depending on the current role
- localize_script but data changes dependent on product ID
- WordPress wp_dequeue_script remove all other scripts
- Add custom css file after plugin css with WordPress Child Theme functions.php
- Is it possible to load recaptcha script only in url with fragment identifier (#)?
- wp enqueue style on about us page
- Test CDN link from function.php or wp_enqueue_script/style?
- Why does my wp_enqueue_script() only insert the script for logged in users
- Unable to declare AOS library in functions
- WP Enqueue Script Error
- How do I dequeue a Stylesheet, stored in an ‘Assets’ folder?
- I need to ‘wp_dequeue_script’ and ‘styles’ and ADD a bunch of other css and js
- I need to completely ‘wp_dequeue_script’; what’s the best way?
- True parameter but jquery register in header and not in the footer with wp_register_script
- Why is style.css not loading through the functions.php
- WordPress Jquery+scripts enqueue issue
- Different body image backgrounds on different pages, posts and categories
- How to wp_enqueue_script with html?
- custom post with loading script per single post
- wp_enqueue_script only works outside of action
- Exclude javascript in certain page url and all following url’s after forward slash
- java script error Uncaught SyntaxError: Unexpected token ILLEGAL
- using enqueue_script in a shortcode isn’t working
- Using array page name together with page id to deregister script
- wp_enqueue_scripts called twice?
- Remove snippets of JS from core
- Why my wp_enqueue_script doesnt work on some page?
- WordPress – Notice: Function wp_enqueue_script was called incorrectly
- dynamically import array from another js file in WordPress
- Auto updating JavaScript dependancy in functions.php
- Loading newest dependency javascript module file in functions.php
- wp_script_add_data not working
- How to programmatically set a menu to be the Primary Menu?
- Trying to inject twitter metadata into using wp_head action in functions.php – get_the_excerpt() returns null
- How to add a slide toggle to the Woocommerce-Layout__Activity-Panel area in the orders admin page
- how can I just add to parent theme function(s) instead of redeclaring whole the function
- Why does re-using this function not work? [closed]
- Function to echo (or display?) wordpress tags in the head section
- Do I Need to Prefix Variables Inside Functions?
- Render page with specific id from functions.php
- Filter works on last selection but no others
- True email confirmation for registration (keeping unvalidated users from user table)
- wordpress function through ajax not being called
- How to mirror exactly the left admin menu on front end?
- Make a table out of meta box