Title: jQuery conflicts
Last modified: August 21, 2016

---

# jQuery conflicts

 *  [samdz](https://wordpress.org/support/users/samdz/)
 * (@samdz)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/jquery-conflicts-4/)
 * Hi,
 * I am working to build wordpress theme from scratch, I installed Js script to 
   my vertical Menu, and plugin to my slideshow,
 * The two work correctly when I installed it without my style.css and my theme 
   built..
 * But when I integrated it to my theme it does not work together!! 🙁
 * I don’t understand where is the problem? is it related to my style.css, php files
   or jQuery conflicts?
 * could you help me please..
 * [http://learn.jquery.com/using-jquery-core/avoid-conflicts-other-libraries/#putting-jquery-into-no-conflict-mode](http://learn.jquery.com/using-jquery-core/avoid-conflicts-other-libraries/#putting-jquery-into-no-conflict-mode).
 * Idon’t inderstand how to use ..I am beginer 🙁
 * Sam

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Maria Antonietta Perna](https://wordpress.org/support/users/antonietta456/)
 * (@antonietta456)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/jquery-conflicts-4/#post-4711101)
 * Are you using jQuery? If so, you need to include the script inside the functions.
   php file in your theme, like this:
 *     ```
       add_action( 'wp_enqueue_script', 'load_jquery' );
       function load_jquery() {
           wp_enqueue_script( 'jquery' );
       }
       ```
   
 * WP already loads jQuery in no conflict mode. Your jQuery script in your js file
   in no conflict mode would look like this:
 *     ```
       (function($) {
          // Your jQuery code goes here. Use $ as normal.
       })(jQuery);
       ```
   
 *  Thread Starter [samdz](https://wordpress.org/support/users/samdz/)
 * (@samdz)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/jquery-conflicts-4/#post-4711132)
 * Hello,
 * Thank you for response,
 * Function.php include that function
 * add_action( ‘wp_enqueue_script’, ‘load_script’ );
    function load_script() { wp_enqueue_script(‘
   jquery’ ); }
 * I tryed to use
 * (function($) {
    // Your jQuery code goes here. Use $ as normal. })(jQuery);
 * but same result.
 * I visited another solution from [http://www.youtube.com/watch?v=1XTGcWANRaQ](http://www.youtube.com/watch?v=1XTGcWANRaQ)
 * I used too:
 * <script type=”text/javascript”>
 *  var jq-$.noConflict();
 *  jq(document).ready(function (){ //Usage
    jq(“.menu ul li”).verticalMenu({ Speed:
   340, effectHide: “fade”, method: “click” }); }); </script>
 * </head>
 * but it generated error to my DW about the row ( var jq-$.noConflict(); )
 * so..
 * I would like to verify, if possible?
 * I installed my js Menu to my header
 * I added that code
 * <link href=”mytheme/style.css” rel=”stylesheet” type=”text/css” />
    <script type
   =”text/javascript” src=”js/menu_min.js”></script> <script type=”text/javascript”
   src=”js/script.js”></script> <script type=”text/javascript” src=”js/jquery.hoverIntent.
   minified.js”></script> <script type=”text/javascript”> (function($) { $(document).
   ready(function (){ //Usage $(“.menu ul li”).verticalMenu({ Speed: 340, effectHide:“
   fade”, method: “click” }); });
 * })(jQuery);
 * </script>
 * <?php wp_head(); ?>
    </head> ———————————–
 * I don’t know if it correct?
 *  I must add ?
 * <script type=”text/javascript” src=”js/jQuery.js”></script>
 * I added it but, nothing changed so I removed it to my head..
 *  [Maria Antonietta Perna](https://wordpress.org/support/users/antonietta456/)
 * (@antonietta456)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/jquery-conflicts-4/#post-4711179)
 * One thing you need to do is to include js scripts the right way: you need to 
   enqueue them rather than hard coding them. You do so in functions.php. Here’s
   a Codex article on how to include scripts:
 * [http://codex.wordpress.org/Function_Reference/wp_enqueue_script](http://codex.wordpress.org/Function_Reference/wp_enqueue_script)
 * Here are some other references:
 * [http://wpcandy.com/teaches/how-to-load-scripts-in-wordpress-themes/#.UyVtVc5KiuI](http://wpcandy.com/teaches/how-to-load-scripts-in-wordpress-themes/#.UyVtVc5KiuI)
 * [http://www.wpbeginner.com/wp-tutorials/how-to-properly-add-javascripts-and-styles-in-wordpress/](http://www.wpbeginner.com/wp-tutorials/how-to-properly-add-javascripts-and-styles-in-wordpress/)
 * Also, if you access the twenty-fourteen theme in the latest WP release and open
   functions.php in a code editor, at about line 225 you can find this function:`
   function twentyfourteen_scripts() { ... }`, which is a clear illustration of 
   how to include styles and scripts in your WP theme.
 * I hope this helps.
 *  Thread Starter [samdz](https://wordpress.org/support/users/samdz/)
 * (@samdz)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/jquery-conflicts-4/#post-4711259)
 * Hello,
 * Thank you for response, and very good tutorials 🙂
 * As beginer, for the moment I don’t understand well how to use enqueue.
 * I had problem of jQuery at all my themes, so I changed pc (localhost)
    And I 
   removed jquery verison of js menu, and now I have not problem of conflict… 🙂
   but I don’t know where was the problem so I am not sure to resolved problem 100%..
 * I don’t know if I can add/integrate javascript Menu (not plugin menu) to my theme..?
   
   Perhaps all my error is there?
 * Sam

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘jQuery conflicts’ is closed to new replies.

 * 4 replies
 * 2 participants
 * Last reply from: [samdz](https://wordpress.org/support/users/samdz/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/jquery-conflicts-4/#post-4711259)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
