From b2c98482f5690263755508b60b05a8ddebe8ad7f Mon Sep 17 00:00:00 2001 From: Antoine M Date: Fri, 24 Nov 2023 15:10:21 +0100 Subject: [PATCH] fixing navwalker warpping for subemnu parent item by fixing global menu class --- includes/navwalker.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/includes/navwalker.php b/includes/navwalker.php index 2cde45c..718c7ed 100644 --- a/includes/navwalker.php +++ b/includes/navwalker.php @@ -6,14 +6,13 @@ function wrap_parent_menu_item_buttons($output, $item, $depth, $args) { - // #### MENU HOMEGRADE HEADER if ($args->theme_location === "homegrade" && $args->menu_id === "menu-homegrade-navlist" && in_array('menu-item-has-children', $item->classes, true)) { $output = ''; } // #### MENU HOMEGRADE FOOTER - if ($args->theme_location === "homegrade" && $args->menu_class === "menu-homegrade-footer" && in_array('menu-item-has-children', $item->classes, true)) { + if ($args->theme_location === "homegrade" && $args->menu_class === "menu-homegrade--footer" && in_array('menu-item-has-children', $item->classes, true)) { $output = '
' . $item->title . '
'; } @@ -48,9 +47,9 @@ function wrap_parent_menu_item_buttons($output, $item, $depth, $args) } } - if ($args->theme_location === "footer" && in_array('menu-item-has-children', $item->classes, true)) { - $output = $item->title; - } + // if ($args->theme_location === "footer" && in_array('menu-item-has-children', $item->classes, true)) { + // $output = $item->title; + // } return $output; } add_filter('walker_nav_menu_start_el', 'wrap_parent_menu_item_buttons', 10, 4);