Archived topic
Remove dropdown functionality for offcanvas parent-child menu items
1 reply · Started by Tina on April 3, 2023
Hi,
I need to achieve an offcanvas menu on both desktop and mobile that groups items together (so I can create my layout with CSS), so what I did is create an offcanvas menu with parent items and child items. Now I have the HTML structure that groups them together which is great, but what I also get and don't want is the dropdown arrow on the parents that opens the child sub-menus.
I can remove that functionality with CSS (display: none on the dropdown arrow and overwrite the necessary rules on the child items to make them permanently visible), but it would be cleaner and better to handle if that functionality just didn't exist in the first place.
Is there a filter or similar that I can use for that or a setting I might have overlooked?
Thank you!
Best,
Tina
Hi Tina,
You can try creating a Block Element - Hook hooked to inside_slideout_navigation.
Then, add a WP Navigation Block.
You can hide the dropdown arrow in its Block settings, but for the sub menu items, you'll still need custom CSS to make them appear all the time.