我有一个WordPress站点,它使用jQuery Mega菜单插件和主题-我-登录都调用:
<script type='text/javascript'src='http://localhost/wadhaa/dynamic/wp-includes/js/jquery/jquery.js?ver=1.11.0'></script>在我的脑子里:
<?php
/* Always have wp_head() just before the closing </head>
* tag of your theme, or you will break many plugins, which
* generally use this hook to add elements to <head> such
* as styles, scripts, and meta tags.
*/
wp_head();
?>我必须包括:
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>与WordPress jquery.js发生冲突。
有人能帮我解决这个问题吗?或者至少让我知道为什么会发生这种冲突。
我从这场冲突中得到的错误是:
Uncaught TypeError: undefined is not a function发布于 2014-06-22 14:41:31
您不需要包含您自己的jQuery,Wordpress已经包含了它,但是$名称是保留的。
只需打电话:
jQuery(function($) {
$('#what_ever_you_want').do_something();
});https://stackoverflow.com/questions/24352299
复制相似问题