Hi, I’m trying to find a way to build a dropdown menu in Wordpress. Whenever I indent the links within Wordpress, the indented submenu items replace the menu item completely. I don’t want to use Bootstrap or Tailwind or a plugin but open to custom php code if necessary.
I looked through previous forum questions, which led me to the new option to select a dropdown menu as a Wordpress action but the documentation doesn’t explain how this works.
Isn’t the natural behaviour when building a Wordpress theme from scratch for the submenu item to sit alongside the menu item, not replace it? I’m literally pulling my hair out trying to make this work. Any help would be greatly appreciated.
Menus are really the weakest point of non-FSE WP IMO. Someone can correct me if I’m wrong, but the Smart Menu WordPress Action in PG should be automatically creating one level-deep dropdowns for you (your code has to be setup with nested unordered lists), but no more than one level deep.
If you want to custom code a solution, you’ll have to work with a custom menu walker. Here’s a great tutorial on custom menu walkers but these things are not very intuitive; it took me a long time to figure out just the basics.
These days I just create my own navigation block for the header (or wherever) b/c the new WP Navigation block is not versatile, so even in the block world, WP navigation is still a headache.