0

Im having trouble loading a superfish menu into Wordpress! i believe i have coded the js and css into the header correctly, as well as amended the wp_menu correctly. But it makes the menu disappear! Please could someone have a look at my code and help?

<!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(); ?>

And this is my wordpress menu call

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

Responses appreciated. Thanks people!

Kirsty

Kirsty Marks
  • 483
  • 8
  • 29

1 Answers1

0

superfish is only required for IE6 afaik, which does not support the

li.menu > li.submenu { display:none } li.menu:hover > li.submenu { display:block }

stuff. So if this is the only feature you want of superfish, just drop it.

Otherwise:

  • use wp_enqueue_script also for the superfish.js
  • $(document).ready(function(){is very likely not to work, check this out: wordpress codex on no conflict jQuery
  • always check you javascript console for errors :-)
Sebastian Schmid
  • 589
  • 5
  • 10
  • Hi Sebastian, thanks for the response. The reason i want a superfish menu is to have a parent indicator with child present you see. ... Ive checked the paths and for some reason it still not working :S – Kirsty Marks Nov 19 '12 at 19:24
  • This issues would be really easy to solve if you could just provide us with a link. – Sebastian Schmid Nov 20 '12 at 15:10