You actually don’t need to worry about conflicting with the admin pages anymore. There is a “wp_enqueue_scripts” hook that makes sure the scripts aren’t called on admin pages.
From WP Codex:
<?php
function my_scripts_method() {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js');
wp_enqueue_script( 'jquery' );
}
add_action('wp_enqueue_scripts', 'my_scripts_method');
?>
But if you need a custom jQuery core (or add-on) for the admin pages, you’ll need to use the “init” hook with the !admin conditional.
Related Posts:
- What is TypeScript and why would I use it in place of JavaScript? [closed]
- How can I check for “undefined” in JavaScript?
- How to make history.back() without getting a warning on the browser to reload the page?
- Split string into array
- convert Hsl to rgb and hex
- How to play audio?
- What does jQuery.fn mean?
- “Uncaught TypeError: Cannot read property ‘style’ of null at.. “
- Difference between document.referrer and window.parent.location.href
- JavaScript replace/regex
- how to render a react component using ReactDOM Render
- What does “javascript:void(0)” mean?
- What does this symbol mean in JavaScript?
- What is the difference between state and props in React?
- Regex for password must contain at least eight characters, at least one number and both lower and uppercase letters and special characters
- OnChange event using React JS for drop down
- how to get the last character of a string?
- Set timeout for ajax (jQuery)
- Escaping Discord subset of markdown
- ESLint Parsing error: Unexpected token
- Angular ForEach in Angular4/Typescript?
- Timers in React Native (this.setTimeout)
- How to handle ETIMEDOUT error?
- bootstrap-datetimepicker for bootstrap 4
- Proper way to wait for one function to finish before continuing?
- XMLHttpRequest module not defined/found
- How do I create and read a value from cookie?
- Check if a variable is of function type
- Bootstrap 4 Dropdown Menu not working?
- document.getElementsByClassName().innerHTML always returns “undefined”
- Bower: ENOGIT Git is not installed or not in the PATH
- Converting an object to a string
- Phone mask with jQuery and Masked Input Plugin
- JQuery get all elements by class name
- SyntaxError: expected expression, got ‘<'
- Attaching ‘onclick’ event to D3 chart background
- declaration or statement expected javascript/typescript
- The preferred way of creating a new element with jQuery
- How to pass parameters using ui-sref in ui-router to controller
- What does ngf-select do and why is it needed for form validation?
- Convert array to JSON
- Is there a way to read standard input with JavaScript?
- How to disable scrolling temporarily?
- JSON.stringify (Javascript) and json.dumps (Python) not equivalent on a list?
- HTML/Javascript change div content
- How do you remove all the options of a select box and then add one option and select it with jQuery?
- Add and remove multiple classes in jQuery
- How To Save Canvas As An Image With canvas.toDataURL()?
- NPM install fails with node-gyp
- What’s the effect of adding ‘return false’ to a click event listener?
- New line in JavaScript alert box
- How do I download a file with Angular2 or greater
- What are alternatives to document.write?
- What are differences between SystemJS and Webpack?
- How to find if div with specific id exists in jQuery?
- TypeError: $ is not a function WordPress
- Fully responsive HTML5 video
- Make Discord bot send picture with message with NodeJS
- RegEx for Javascript to allow only alphanumeric
- Remove extra Google Maps script
- Include jQuery UI as a whole
- How to echo JS right after enqueued script to put it into noConflict mode?
- Gutenberg extend blocks add new class name
- How to wrap the content of the main tinyMCE editor with extra tags
- Rest API authentication issue when called from fetch request in bundle.js
- Javascript not working?
- Add Item to Custom TinyMCE Menu
- Listbox return wrong value in WordPress 3.9
- Logout user and delete cookies from the client side?
- wp_enqueue_script & constants?
- How do developers add “Smooth Transitions” to their sites?
- Resolving Javascript errors likely related to Gantry framework
- How can I get my Calculate Contact Form 7 field to update with jQuery? [closed]
- I am trying to add current logged in user to my zoho chat
- Where to upload JavaScript file in WordPress
- Calling a WordPress Custom JavaScript file
- Conditional save return on Gutenberg Block
- Can I alter the block editor’s paste text behavior?
- Custom Block – save.js function not saving attributes
- Headless wp with react. How to handle routes?
- Issues trying to get an element by id
- How do I know if I should enqueue JS code or just include it in ONE PHP function?
- How do I use this javascript correct with wordpress?
- How can I integrate yepnope.js with WordPress (and plugins)?
- How to set javascript options for select2 in PHP array of plugin
- Multiple jQuery inputs or binds in Customizer Control Javascripts
- How to display different content on the same page using different URLS
- Change background video when scrolling reaches a certain ID
- Immediate (e.g. without DOMContentLoaded) JS not working
- Client side pre-save Javascript hook on all admin pages
- Dynamically changing logo on scroll function [closed]
- Script not working in post content
- How to identify which javascript is being executed
- Remove WordPress default registration client side validation?
- How could I add load more posts to my theme? [closed]
- How to keep close a sub-menu under homepage? [closed]
- How to implement custom URL handler to access JS modal content? [closed]
- Javascript button to call custom fields data
- Javascript 2 elements dependent onclick .toggle [closed]
- Use add_action to run a script, but only on the post editor page