Menu icon Foundation
Foundation 5 WordPress Off-Canvas multi-level menu issue

Need advice on Foundation 5 multi-level off-canvas menu support in WordPress. I have a very simple two level menu:

a
b
c
1
2
3
4
d
e

Everything works well until I select item 2/3 or 4. The selection takes me to the correct page, but on return to the off-canvas menu, it is not possible to click on any of the menu items, and the entire menu is overlaid with a slightly lighter colour.

I don't use a custom walker but have these items in my functions.php:
// Replace wp menu classes with foundation menu classes:
function my_nav_menu($menu){
$menu = str_replace('menu-item-has-children', 'menu-item-has-children has-dropdown', $menu);
$menu = str_replace('sub-menu', 'sub-menu dropdown', $menu);
return $menu;
}
add_filter('wp_nav_menu','my_nav_menu');

// Force WordPress to style sticky posts using the .wordpress-sticky class instead of .sticky
if ( ! function_exists( 'my_remove_sticky_class' ) ) {
function ppfifteen_remove_sticky_class($classes) {
$classes = array_diff($classes, array("sticky"));
$classes[] = 'wordpress-sticky';
return $classes;
}
}
add_filter('post_class','my_remove_sticky_class');

I'm convinced it is something very simple, but that something is eluding me.

Can anyone shed any light on this problem?

Thanks,

Brian

Foundation 5off-canvas menumulti-level off-canvas menuwordpressWordPress WalkerWordPress function.php

Need advice on Foundation 5 multi-level off-canvas menu support in WordPress. I have a very simple two level menu:

a
b
c
1
2
3
4
d
e

Everything works well until I select item 2/3 or 4. The selection takes me to the correct page, but on return to the off-canvas menu, it is not possible to click on any of the menu items, and the entire menu is overlaid with a slightly lighter colour.

I don't use a custom walker but have these items in my functions.php:
// Replace wp menu classes with foundation menu classes:
function my_nav_menu($menu){
$menu = str_replace('menu-item-has-children', 'menu-item-has-children has-dropdown', $menu);
$menu = str_replace('sub-menu', 'sub-menu dropdown', $menu);
return $menu;
}
add_filter('wp_nav_menu','my_nav_menu');

// Force WordPress to style sticky posts using the .wordpress-sticky class instead of .sticky
if ( ! function_exists( 'my_remove_sticky_class' ) ) {
function ppfifteen_remove_sticky_class($classes) {
$classes = array_diff($classes, array("sticky"));
$classes[] = 'wordpress-sticky';
return $classes;
}
}
add_filter('post_class','my_remove_sticky_class');

I'm convinced it is something very simple, but that something is eluding me.

Can anyone shed any light on this problem?

Thanks,

Brian

Rafi Benkual over 4 years ago

This gist was posted recently - https://gist.github.com/zzramesses/0e7cd411045e11571448 Should help.