IM_natascha
Member
Posted 1 year ago #
Hey guys,
I want to alter my registration form and need some javascript for it. I would like to use the jquery-library, but cannot manage to include it via wordpress-functions.
As in WordPress Function Reference - wp_enqueue_script I use the init-Hook, after trying get_header, wp_head, wp_enqueue_scripts but neither of them worked.
add_action('init', array(&$this, 'add_jquery'));
function add_jquery(){ wp_enqueue_script( 'jquery' ); }
What am I missing?
Why are you trying to re-load jQuery?
IM_natascha
Member
Posted 1 year ago #
Funny - if it would have been loaded, my test should have worked but didn't. So I thought, I needed to load jQuery.
As my function didn't work, I hardcoded the import of jQuery.
I tested it right now - without my hardcoded jQuery-Import my Script does not work, so jQuery is most likly not imported. I even searched the html-code, but as expected didn't find anything about jQuery.
Maybe the jQuery-Lib is not loaded for the registration page.
IM_natascha
Member
Posted 1 year ago #
Is there anyone who knows a solution?