JQuery.js WordPress冲突
我有一个WordPress网站,它使用jQuery Mega Menu插件和theme-my-login两个调用:
在我的头部分:
<?php /* Always have wp_head() just before the closing * tag of your theme, or you will break many plugins, which * generally use this hook to add elements to such * as styles, scripts, and meta tags. */ wp_head(); ?>
我必须包括:
这导致与WordPress jquery.js冲突
任何人都可以帮我解决这个问题吗? 或者让我知道为什么会发生这种冲突。
我从这场冲突中得到的错误是:
Uncaught TypeError: undefined is not a function
你不需要包含自己的jQuery,Wordpress已经包含它,但$
name是保留的。
只需致电:
jQuery(function($) { $('#what_ever_you_want').do_something(); });