WordPress has its own version of jQuery that you should use. It is generally advised to use the built-in WordPress version of jQuery instead of a different version.
The WordPress version of jQuery removes all definitions of
$ from the global scope, meaning, you have to type ‘jQuery’ instead of ‘$’ to use the jQuery library. This is basically so that libraries don’t conflict with each other by all trying to define the $ sign as a variable.
Because of this, you might run into issues where Bootstrap is unable to add functions to jQuery. I ran into this particular problem just today.
I was getting the error message:
TypeError: $(...).scrollspy is not a function
You may get other errors as well, saying `$` is undefined.
What this means is, Bootstrap was expecting the dollar sign to be defined, but it wasn’t, because WordPress undefines it.
The solution? Temporarily define $ and then undefine it.
Essentially, you set $ to jQuery, load the library you need, then unset $ by calling
jQuery.noConflict(true), and there you have it.