2012-11-19 43 views
0

Im在加载WordPress的超级菜单时遇到了麻烦!我相信我已经正确地将js和css编码到标题中,并且正确修改了wp_menu。但它使菜单消失!请有人看看我的代码和帮助?将Superfish集成到Wordpress中

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title><?php bloginfo('name'); ?> <?php if (is_single()) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title> 
<meta name="keywords" content="Holiday, free CSS template, clean, neat, aqua, white, templatemo" /> 
<meta name="description" content="Holiday is a clean and neat free CSS template using aqua and white colors." /> 
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" /> 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> 
<script type="text/javascript" charset="utf-8"></script> 
<!-- Include jQuery --> 
<?php wp_enqueue_script('jquery'); ?> 
<script src="<?php bloginfo("template_url"); ?>/js/superfish.js" type="text/javascript"></script> 
<script> 

$(document).ready(function(){ 
    $("ul.sf-menu").superfish(); 
}); 

</script> 
<?php wp_head(); ?> 

这是我的wordpress菜单调用

<?php wp_nav_menu(array('theme_location' => 'primary', 'menu_class' => 'sf-menu',)); ?> 

回应赞赏。感谢人们!

科斯蒂

回答

0

SUPERFISH仅需要IE6 AFAIK,其不支持

li.menu> li.submenu {显示:无} li.menu:hover> li.submenu {显示:block}

东西。所以如果这是你想要的超级鱼的唯一功能,就放弃它。

否则:

  • 使用wp_enqueue_script也为superfish.js
  • $(document).ready(function(){很可能不工作,检查了这一点:wordpress codex on no conflict jQuery
  • 经常检查你的JavaScript控制台:-)
  • 错误
+0

嗨塞巴斯蒂安,谢谢你的回应。我想要一个超级鱼菜单的原因是有一个父母指标与你看到的孩子。 ...我检查了路径,由于某种原因,它仍然无法正常工作:S –

+0

如果您只是向我们提供链接,这个问题将非常容易解决。 –