How to use jQuery noConflict mode in WordPress

How to use jQuery noConflict mode in WordPress

We are going to discuss how to properly use jQuery noConflict mode in WordPress. Because many times we face or jQuery not found or undefined issue in WordPress. So, Today we are going to learn how to write properly the jQuery code in WordPress.

How to use jQuery noConflict mode in WordPress

So whenever you need to write the jQuery code in WordPress then you should follow the jQuery noConflict syntax. Just follow the below syntax for writing jQuery code properly.

(function($){

  $(document).ready(function(){
    // write code here
  });

  // or also you can write jquery code like this

  jQuery(document).ready(function(){
    // write code here
  });

})(jQuery);

Now, you can write the jQuery code using $ and jQuery without getting the undefined or not defined error on the console.

I hope this article useful for you. Still, If you face any issue related to jQuery on WordPress. Please let us know by comment.

Related Posts

  1. WordPress Button Shortcode – Add button to WordPress editor
  2. WordPress shortcode – How to create shortcode in WordPress
  3. WordPress change URL in database using MySQL Query
  4. WordPress jQuery is Not Defined or undefined
  5. Enable shortcodes in widget WordPress
  6. Bootstrap 4 show Dropdown menu on hover mouse
  7. jQuery on Hover mouseenter and mouseleave events
  8. WooCommerce add product to cart with custom price
  9. jQuery append element at first position on the lists

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search Posts

Subscribe To Newsletter

Get Early Access To New Articles, Plugins, Discount Codes And Quickly Brief Updates about tips and tricks

Join 308 other subscribers