In simple case you need to enqueue script before header scripts are printed, which happens in wp_head
hook.
Basic approach would be this in functions.php
of your theme:
add_action('wp_enqueue_scripts', 'my_enqueue_scripts');
function my_enqueue_scripts() {
wp_enqueue_script('jquery');
}
Related Posts:
- Move WordPress native javascript to bottom of page?
- RequireJS in custom theme. Working Example
- How to get a jQuery script to run on a page?
- Including javascript for a shortcode
- Asynchronous Javascript Loaders
- wp_enqueuescript won’t load in footer even with true value set?
- How do I get my page to load the jQuery UI Effects library?
- Script won’t execute in the media manager
- How to properly add Bootstrap and JQuery Javascripts?
- Enqueuing javascript files
- Searching multiple tags and adding jQuery dependant script onto page template?
- Plugin Scripts no loading on options page
- How to enque js script in footer that are not in .js file?
- Loading scripts on a single page plants the script in the footer
- Using WP functions inside javascript
- Including Older Version of jQuery for IE7/IE8
- How To Include JavaScript Files Only In Single Posts?
- How to make JQuery load on top of head tag before everything
- JavaScript code do not works on online server
- Bootstrap with separate js File
- How to add JS snippet before closing tag?
- Enqueue javascript that inserts custom php widget into jQuery-constructed div
- How to Run a jQuery Script after a Javascript Script has Finished in WordPress
- javascript not loading in wordpress
- bootstrap-slider.js by seiyria not working in wordpress
- JavaScript sleep/wait before continuing [duplicate]
- Why does my JavaScript code receive a “No ‘Access-Control-Allow-Origin’ header is present on the requested resource” error, while Postman does not?
- How do I link a JavaScript file to a HTML file?
- jQuery equivalent of JavaScript’s addEventListener method
- Adding an onclick function to go to url in JavaScript?
- Checking a Url in Jquery/Javascript
- Best way to store a key=>value array in JavaScript?
- When and why to ‘return false’ in JavaScript?
- How is JavaScript .on() method defined?
- Javascript isnull
- JQuery: $.get is not a function
- How can I expand and collapse a using javascript?
- Javascript : array.length returns undefined
- How to include jQuery and JavaScript files correctly?
- How do I make script load after jquery?
- Correct Method to run scripts with dependencies without enqueue?
- Can’t get a JSON object in response to an Ajax request with wp_ajax
- How to prevent wordpress from loading old versions of jquery in wp_head();?
- Best Practices for Seperating jQuery from HTML/PHP
- Add custom shortcode button to Editor
- jQuery in header or footer
- Modify Custom Field in Media Library using JavaScript
- Moving jQuery to the footer without using de-register in WordPress
- wp_enqueue_script and wp_register_script in theme not working
- How to Use JSON With AJAX?
- Enqueue jQuery in WordPress
- Using wp_ajax and wp_ajax_nopriv hooks
- Hide/show customizer controls based on other settings in Customizer
- jQuery on Underscores menu
- When does WordPress automatically enqueue jQuery?
- How to add unique image class to WordPress
- jQuery Tree View and wp_list_pages
- Jquery conflict
- WordPress loads Jquery Automatically – is my idea correct to add it to the footer?
- Loading posts via AJAX in a hidden div with updated URL?
- Best way to include jQuery and fire with script at bottom of container
- How to show jquery popup only in one page or once?
- Enqueue WordPress jQuery after it’s been deregistered by a plugin
- how to en-queue jQuery to load before the tag
- Limit filetype and wp media
- Cannot enqueue jQuery correctly using Google CDN
- Problem getting .js file to load via a plugin
- Using jquery-1.7.2.min.js instead of the wordpress jquery
- WordPress error when replacing local jQuery by externally-hosted
- “JQMIGRATE: Migrate is Installed” How do I find the problem code? [duplicate]
- Referrer URL with jQuery or Javascript – Cache & Referrer URL Issue
- Create special WordPress slideshow with “jquery.cycle.all.js”
- Ajax Validation for reCaptcha
- Disable Cloudflare Rocket Loader for jQuery javascript and make it load first
- jQuery selectable() function won’t work in wordpress
- oEmbed Video in Modal
- AJAX Success Function using JS substr() fails in WP 4.1 vs 4.0
- wordpress before or after javascript problem
- Ajax page load in wordpress the right way?
- Bootstrap and jQuery error: $ is not defined
- Fire action after enqueue script
- I am trying to Implement a Code that is Working in my previous page but not working in WordPress for some reason
- How to use $ with externally loaded javascript
- Getting click on item to open closest relevant element (popup) with jQuery
- Uncaught ReferenceError: jQuery is not defined
- why does so many javascript libraries are loaded along with my website?
- Why does my media selection script write to ONLY the first input field?
- Modify the href attribute of tag dynamically in WordPress
- Add a jQuery snippet for sepcific user role
- Move jQuery on *top* of footer
- JQuery and Javascript to pan image
- How to get this jQuary script working?
- Youtube Iframe Api play one video at a time
- Disable drag metaboxes, create many functions using js not to work!
- Scripts only working on home page
- JS plugin script loading but not working
- Are you sure popup on Contact Form 7 [closed]
- jQuery ajax empty exeption on wordpress
- JS file not loading [closed]
- Uncaught ReferenceError: tippy is not defined