Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Has anyone managed to get the FlexNav plugin - http://jasonweaver.name/lab/flexiblenavigation/ - working with WordPress?

I've got an HTML version of the site working fine, but I'm running into trouble when integrating with WordPress as WordPress uses it's own classes, ids etc. on menu items and this seems to override the flexnav plugin.

I'm wondering if I should be trying to replicate the menu structure that the plugin creates using a custom walker function, or just re-writing the CSS with what WordPress gives me?

Any advice appreciated!

Thanks

share|improve this question
3  
This plugin relies on a global variable $. See wordpress.stackexchange.com/questions/2895/… – you should write a bug report. –  toscho May 28 '13 at 14:53
add comment

1 Answer

up vote 1 down vote accepted

You don't need a custom walker function. You can alter wp_nav_menu like this:

    wp_nav_menu( array( 
    'theme_location' => 'primary',
    'menu_class' => 'flexnav', //Adding the class for FlexNav
    'items_wrap' => '<ul data-breakpoint="800" id="%1$s" class="%2$s">%3$s</ul>', // Adding data-breakpoint for FlexNav
    ));

and proper script init should be:

jQuery(document).ready(function($){
   $(".flexnav").flexNav({
});
});

Drop menu button somewhere outside navigation:

<div class="menu-button">Menu</div>

But still does not work. As toscho refered, FlexNav needs a small modification to work in WordPress. Take a look this mod here http://pastebin.com/ZEMQFFsA

UPDATE: Since v.1.0 FlexNav support jQuery noConflict mode

share|improve this answer
    
Thanks so much, that works perfectly! –  Chloe May 29 '13 at 14:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.