I use an FSE theme and as you might know the Navigation block is pretty limited. I want to implement a custom mega-menu-ish navigation for a big website.
Is there any way to enable the Appearance->Menus in the admin dashboard while FSE theme is enabled, so that I could use a shortcode to implement this?
2 Answers
Is there any way to enable the Appearance->Menus in the admin dashboard while FSE theme is enabled
I noticed that in some FSE themes the classic Menus admin page shows up under Appearance:
when they include a register_nav_menus( ... )
call within the after_setup_theme
hook to define the relevant classic menu locations.
See for example the Raft theme's setup:
https://themes.trac.wordpress.org/browser/raft/1.0.3/inc/Core.php#L87
It's also possible to select classic menus within the Navigation block:
We note that the "Manage menus" link in the Navigation block is
/wp-admin/edit.php?post_type=wp_navigation
and it is not pointing the classic Menus admin page:
/wp-admin/nav-menus.php
-
2Wow that worked. Just place
register_nav_menus( array( 'primary' => esc_html__( 'Primary Menu', 'raft' ) ) );
infunctions.php
and it appeared in the sidebar. Commented Oct 11, 2022 at 10:54 -
... and it should be possible to call classic menu within the Navigation block– birgireCommented Oct 11, 2022 at 10:56
-
-
I used the code but I cannot find how to call the classic menu in the fse editor. In the navigation block it doesn't appear the option as you posted in the screenshot. could you help me finding a solution? Commented Mar 4 at 8:52
I followed the instructions, and i managed to create a menu in the classic menu editor. However the "Select Menu" button in the Gutenberg editor is not showing up. Any ideas how to get that working? Thanks.
-
This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review Commented Sep 6 at 13:24