我是 wordpress 的初学者级开发人员,现在我正在尝试将我的 html 转换为 wordpress。我的 html 中几乎没有 jquery。但转换后我的 jquery 似乎无法正常工作.. 它显示以下错误
Uncaught TypeError: Object [object Object] has no method 'superfish'
请帮我解决问题..
头文件.php
<!DOCTYPE html>
<!--[if lt IE 7]> <html dir="ltr" lang="en-US" class="ie6"> <![endif]-->
<!--[if IE 7]> <html dir="ltr" lang="en-US" class="ie7"> <![endif]-->
<!--[if IE 8]> <html dir="ltr" lang="en-US" class="ie8"> <![endif]-->
<!--[if gt IE 8]><!--> <html dir="ltr" lang="en-US"> <!--<![endif]-->
<head>
<!--meta tag-->
<meta http-equiv="Content-Type" charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width,initial-scale=1.0" >
<!--Title-->
<title><?php echo wp_title( '|', true, 'right' );?></title>
<!--Stylesheets-->
<link rel="stylesheet" href="<?php echo bloginfo('template_directory'); ?>/css/style.css" type="text/css" media="all" />
<link rel="stylesheet" href="<?php echo bloginfo('template_directory'); ?>/css/colour.css" type="text/css" media="all" />
<link rel="stylesheet" href="<?php echo bloginfo('template_directory'); ?>/css/flexslider.css" type="text/css" media="all" />
<link rel="stylesheet" href="<?php echo bloginfo('template_directory'); ?>/css/superfish.css" type="text/css" media="all" />
<link rel="stylesheet" href="<?php echo bloginfo('template_directory'); ?>/css/responsive.css" type="text/css" media="all" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Merriweather:400,300,700,900' rel='stylesheet' type='text/css'>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<!--Favicon-->
<link rel="shortcut icon" href="<?php echo bloginfo('template_directory'); ?>/favicon.html" type="image/x-icon" />
<!--JavaScript-->
<script type="text/javascript" src="<?php echo bloginfo('template_directory'); ?>/js/jqueryui.js"></script>
<script type='text/javascript' src='<?php echo bloginfo('template_directory'); ?>/js/jqueryui1.js'></script>
<script type="text/javascript" src="<?php echo bloginfo('template_directory'); ?>/js/superfish.js"></script>
<script type="text/javascript" src="<?php echo bloginfo('template_directory'); ?>/js/jquery.flexslider-min.js"></script>
<script type="text/javascript" src="<?php echo bloginfo('template_directory'); ?>/js/tinynav.min.js"></script>
<script type="text/javascript" src="<?php echo bloginfo('template_directory'); ?>/js/jquery.uniform.js"></script>
<script type="text/javascript" src="<?php echo bloginfo('template_directory'); ?>/js/scripts.js"></script>
<!--[if (gte IE 6)&(lte IE 8)]>
<script type="text/javascript" src="js/selectivizr-min.js"></script>
<![endif]-->
<?php wp_head(); ?>
</head>
<body id="top" class="loading">
<div id="header-wrapper">
<!-- BEGIN #header-border -->
<div id="header-border">
<!-- BEGIN #header-top -->
<div id="header-top" class="clearfix">
<ul class="top-left-nav clearfix">
<li><a href="#">Payment</a><span>/</span></li>
<li><a href="#">Terms and Conditions</a><span>/</span></li>
</ul>
<ul class="top-right-nav clearfix">
<li class="phone-icon">+1 919 673 3608</li>
<li class="email-icon">alexmm@k2asoftwaresolutions.com</li>
</ul>
<!-- END #header-top -->
</div>
<!-- BEGIN #header-content-wrapper -->
<div id="header-content-wrapper" class="clearfix">
<div id="logo">
<h1><a href="index.php"><img src="<?php echo bloginfo('template_directory'); ?>/images/logo.png"</a></h1>
</div>
<ul class="social-icons clearfix">
<li><a target="_blank" href="#"><span class="twitter-icon"></span></a></li>
<li><a target="_blank" href="#"><span class="facebook-icon"></span></a></li>
<li><a target="_blank" href="#"><span class="gplus-icon"></span></a></li>
<li><a target="_blank" href="#"><span class="pinterest-icon"></span></a></li>
<li><a target="_blank" href="#"><span class="flickr-icon"></span></a></li>
<li><a target="_blank" href="#"><span class="youtube-icon"></span></a></li>
<li><a target="_blank" href="#"><span class="vimeo-icon"></span></a></li>
<li><a target="_blank" href="#"><span class="skype-icon"></span></a></li>
<li><a target="_blank" href="#"><span class="rss-icon"></span></a></li>
</ul>
<!-- END #header-content-wrapper -->
</div>
<div id="main-menu-wrapper" class="clearfix">
<!-- BEGIN #main-menu-wrapper -->
<?php wp_nav_menu( array(
'theme_location' => '',
'container'=> '',
'container_class' => '',
'container_id' => '',
'menu_class'=>'',
'menu_id'=>'main-menu',
'item_wrap'=>'<ul></ul>'
)
); ?>
<!-- END #main-menu-wrapper -->
<div class="menu-search-button"></div>
<form method="get" action="#" class="menu-search-form">
<input class="menu-search-field" type="text"
onBlur="if(this.value=='')this.value='To search, type and hit enter';"
onFocus="if(this.value=='To search, type and hit enter')this.value='';"
value="To search, type and hit enter" name="s" />
</form>
</div>
Script.js(从哪里调用 jquery)
jQuery(document).ready(function() {
// Main Menu Drop Down
jQuery('ul#main-menu').superfish({
delay: 600,
animation: {opacity:'show',height:'show'},
speed: 'fast',
autoArrows: true,
dropShadows: false
});
$.noConflict();
// Accordion
jQuery( ".accordion" ).accordion( { autoHeight: false } );
$.noConflict();
// Toggle
jQuery( ".toggle > .inner" ).hide();
jQuery(".toggle .title").toggle(function(){
jQuery(this).addClass("active").closest('.toggle').find('.inner').slideDown(200, 'easeOutCirc');
}, function () {
jQuery(this).removeClass("active").closest('.toggle').find('.inner').slideUp(200, 'easeOutCirc');
});
$.noConflict();
// Tabs
jQuery(function() {
jQuery( "#tabs" ).tabs();
});
$.noConflict();
// PrettyPhoto
jQuery(document).ready(function(){
jQuery("a[rel^='prettyPhoto']").prettyPhoto();
});
$.noConflict();
// Search Button Toggle
jQuery(".menu-search-button").click(function() {
jQuery(".menu-search-field").toggleClass("menu-search-focus", 200);
});});