Installing jQuery plugin into wordpress

I have a form that a user will fill out based on fitness test results i.e. push ups per minute, sit ups per minute, 2 mile run time etc. This form is submitting to a custom template page which also works fine. I would however like to use this jquery plugin to help me validate my form.

How do I add jQuery libraries like this into wordpress so i can validate my form

Related posts

Leave a Reply

1 comment

  1. Open your functions.php and add this code:

    //ad our custom Jquery
     function init_js_scripts() {
    if (!is_admin()) {
        wp_register_script('jquery', ('http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'), false, '');
        wp_enqueue_script('jquery');
    
        // load a JS file from your  theme: js/theme.js
        //You will need to create js Folder and put your script in there...
        wp_enqueue_script('my_cool_script', get_template_directory_uri() . '/js/cool_script.js', array('jquery'), '1.0', true);
    }
        }
        add_action('init', 'init_js_scripts');