Just use deps
parameter to include jQuery, change your code to:
function add_my_css_and_my_js_files() {
wp_register_script( 'validate', plugins_url( '/validate.js', __FILE__ ), array( 'jquery' ) );
wp_enqueue_script('validate');
}
add_action( 'wp_enqueue_scripts', "add_my_css_and_my_js_files" );
Related Posts:
- What does [object Object] mean? (JavaScript)
- How to Handle Button Click Events in jQuery?
- How can I get the ID of an element using jQuery?
- jQuery Ajax error handling, show custom exception messages
- jQuery if div contains this text, replace that part of the text
- Javascript Runtime error: $ is undefined
- Ajax TypeError: $.POST is not a function
- Yes or No confirm box using jQuery
- Javascript TypeError: Cannot read property ‘indexOf’ of undefined
- jQuery – Add ID instead of Class
- Random background images CSS3
- How can I remove all CSS classes using jQuery/JavaScript?
- Create, read, and erase cookies with jQuery [duplicate]
- Toggle Checkboxes on/off
- jQuery ajax error function
- How to scroll up or down the page to an anchor using jQuery?
- Passing boolean values with wp_localize_script
- Concatenate and minify dependencies for enqueued JavaScript files
- Do I need both jquery.js and jquery-migrate.min.js?
- How to load the WordPress jquery in the section
- wordpress json custom taxonomy problem
- tinymce is not defined when not using wp_editor
- Require featured image
- How can I add a jQuery OnClick event to the Publish posts button?
- As a plugin developer, how to deal with theme developer loading jquery from google?
- Best Way to Include Scripts on a Specific Template Page
- AJAX post into pop-up div
- chosen jquery library not loading – is not a function error
- jQuery in WordPress – Why is it not working?
- jQuery UI AutoComplete not working in wordpress?
- Updating User Profile with AJAX not working
- Auto Load New Posts
- wp_ajax() question.. not using wp_enqueue_script?
- What do I need jQuery for?
- How to include jQuery when no header and footer on the page
- Showing Author Information and Latest Post by author in lightbox when clicked on the name of the author
- Load jQuery inside Page Template
- WP Admin missing icons, numerous JavaScript errors, but only when SCRIPT_DEBUG is false
- Returning content via jQuery without footers on admin pages
- Make inline edit in wp_list_table
- Will the latest Bootstrap work properly with the default WordPress jQuery?
- jQuery is missing in wp-admin
- How to embed JS data viz in a simple WordPress website
- Rhyzz Repeatable-fields javascript in php and wordpress
- How can I integrate User generated/dynamic fields in Contact form 7?
- Using Bootstrap Switch with WordPress
- wp_enqueue_ scripts
- Yoast SEO breaking media upload
- window.onload wont execute in wordpress
- jquery does’t work
- How to fix my old theme so it loads jQuery properly
- How do I include javascript/jquery image resizing with wordpress?
- Title on hovering on the featured image
- Loading a newer version of jQuery within WordPress
- WordPress 3.1 makes my drop down menu dissapear, jquery dont work
- Having trouble setting / modifying cookies
- Loading dynamic content with AJAX breaking jQuery
- How to display comments length
- Adding JavaScript file in Admin Panel
- How do I use jQuery to add the TinyMCE WYSIWYG editor to a textarea?
- How to change the text of the “You are about to permanently delete these items…” alert message when deleting media from the media library?
- why is my wordpress Jquery-Ajax call not working?
- Unable to get my javascript to work on my website – what am I doing wrong?
- Using jquery with wordpress using wp_enqueue_scripts
- get value from selected input
- jQuery script doesn’t work on WordPress
- Contact form 7 issue with jquery – hiding/showing fields [duplicate]
- Admin Ajax is returning 0 and not Insert data
- Multiple Media uploader output to input
- Can’t add classes using jQuery from a JSON string with get_body_class()
- Ajax call through admin-ajax.php returns 404 error
- Why does deregistering jQuery cause other scripts not to load?
- How to add external remote JS source to Gravity Forms?
- inner jQuery won’t work
- Why is ajax working on one server and not the next?
- Insert a Featured Video
- jQuery forms & updating info
- wordpress file upload from direct directory not working
- Gutenberg Gallery Block – How to get the full image url in Javascript/jQuery?
- Override parent theme deregister
- jQuery Validation plugin and Bootstrap 4 CSS classes
- About Rendro Countdown
- Orderby post__in Not Working Correctly?
- $ not defined using jQuery in WordPress
- JavaScript code do not works on online server
- How to get my insert.php url in jquery?
- Jquery script with comments ID’s
- comment-reply.js disables any other form javascript
- Jquery being loaded wrong
- How to add jQuery script?
- Displaying contents of a tab
- Variable not being returned from Ajax Javascript (though javascript receives it)
- Append jquery script for each [partners] shortcode with specified values
- How to respond with WP_Ajax_Response();
- Thumbnail remove width & height function
- Trying to get fittext to work in WordPress
- getJSON on WordPress Page
- Show / hide DIV with jQuery – doesn’t work in one page
- Custom JQuery script in page template won’t work [duplicate]
- How can I use jQuery maphilight?