WordPress wp_nav_menu and superfish
-
Hello. For the life of me I can’t get the superfish navbar javascript to work with the wp_nav_menu as a child theme of twentyeleven.
The superfish option I’m trying to integrate is this one and I’ve followed the instructions as I understand them.
I’ve included a link to the stylesheets in my header.php, like so:
<link rel=”stylesheet” media=”screen” href=”<?php bloginfo( ‘stylesheet_directory’ ); ?>/css/superfish.css” />
<link rel=”stylesheet” media=”screen” href=”<?php bloginfo( ‘stylesheet_directory’ ); ?>/css/superfish-navbar.css” />
… just above the pinkback_url link.Below the wp_head(), I’ve included links to the js files, like so:
<script src=”<?php bloginfo( ‘stylesheet_directory’ ); ?>/js/hoverIntent.js”></script>
<script src=”<?php bloginfo( ‘stylesheet_directory’ ); ?>/js/superfish.js”></script>And below that, the initialisation of the script:
<script>
$(document).ready(function(){
$(“ul.sf-menu”).superfish({
pathClass: ‘current’
});
});
</script>As for the menu bit in the #access div:
<nav id=”access” role=”navigation”>
<h3 class=”assistive-text”><?php _e( ‘Main menu’, ‘twentyeleven’ ); ?></h3>
<?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. */ ?>
<div class=”skip-link”>“><?php _e( ‘Skip to primary content’, ‘twentyeleven’ ); ?></div>
<div class=”skip-link”>“><?php _e( ‘Skip to secondary content’, ‘twentyeleven’ ); ?></div>
<?php /* Our navigation menu. If one isn’t filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?>
<?php wp_nav_menu( array( ‘theme_location’ => ‘primary’, ‘menu-class’ => ‘sf-menu sf-navbar’ ) ); ?>
</nav><!– #access –>Evidently I’m missing something. Thanks for any help in advance.
- The topic ‘WordPress wp_nav_menu and superfish’ is closed to new replies.