wp-bootstrap-navwalker icon indicating copy to clipboard operation
wp-bootstrap-navwalker copied to clipboard

Flat menu's getting wrong class

Open joelstransky opened this issue 12 years ago • 4 comments

Superb class you have here. Worked wonders for my theme. There's a problem however when I request a menu with a depth of 1. A menu item with sub items still shows the down arrow icon and doesn't link to the page. For instance if I have: /our-company --> /history --> /staff etc. the main menu works great but I have another call to that menu in the footer that's flat. The our-company link should link to the parent page instead of do nothing.

I can of course create a separate menu in the admin but thought I'd point this out.

joelstransky avatar Dec 19 '13 23:12 joelstransky

Interesting... I will definitely take a look ook at this. Just to confirm I have your scenario correct.

You're saying that you are using one menu defined in the WordPress admin and calling via two separate wp_nav_menu definitions one with a depth of 1 and another with a depth of 2?

SideQuestDIY avatar Dec 27 '13 23:12 SideQuestDIY

I think that's exactly what he means, so he has the main menu with the depth of 2 and the footer menu with the depth of 1 to have those items link back to their corresponding pages. The one with the issue is the item that has children in this case the "our-company" item. I'm thinking that he can just add && $args['depth'] != 1 to the if statement on line 84 (line number is from the file in this repo). What do you think?

jerrylopez avatar Dec 28 '13 00:12 jerrylopez

I am working on an update for this. As much as I am not a fan of top level pages for dropdowns, I absolutely agree that this is how it is expected to work.

After some thought, making these changes it has bigger implications for other sections of the script and that will require a more robust implementation.

SideQuestDIY avatar Jan 15 '14 15:01 SideQuestDIY

This is a very old issue thread and a future branch has the flat menus issue fixed.

Closing this issue.

pattonwebz avatar Jun 18 '17 18:06 pattonwebz