I read the Codex and a few blog posts about using jQuery in WordPress, and its very frustrating. I\'ve got as far as loading jQuery in functions.php
file, but a
you can write your script in another file.And enqueue your file like this
suppose your script name is image-ticker.js
.
wp_enqueue_script( 'image-ticker-1', plugins_url('/js/image-ticker.js', __FILE__), array('jquery', 'image-ticker'), '1.0.0', true );
in the place of /js/image-ticker.js
you should put your js file path.