You probably already know that activating a block theme removes the Customizer and the Menus screen from the sidebar in the WordPress admin area. They are still part of WordPress, and you can still access them by visiting the pages directly:
- wp-admin/customize.php
- wp-admin/nav-menus.php
You may want to re-enable these features if your users/customers are struggling with the new site editing features. For example, if they are not comfortable creating new menus using the navigation block.
Estimated reading time: 2 minutes
Last updated
Activating a plugin that uses the Customizer re-enables the links
I am mentioning this mostly as an assurance: If you activate a plugin that uses the Customizer, like Yoast SEO or WooCommerce, then WordPress will re-enable the Customizer links automatically. In this case you don’t need to make any changes to the theme, and you don’t need to worry about compatibility.
Re-enable the Customizer with the customize_register hook
The other way to re-enable the Customizer is to use the customize_register hook. Add the hook to your theme, for example in the functions.php file.
Just like with the plugin example, WordPress will add the links automatically. You do not need to make any code changes for the admin menu or the admin bar itself.
You can register actual Customizer options for your block theme. Or you can use return true as the callback for add_action()
. -Either way, the action must include a callback, or it will cause a fatal PHP error. Example:
add_action( 'customize_register', '__return_true' );
Re-enable Menus with theme support
To show the link the menu screen at Appearance > Menus, all you need is to register the theme support. Add this in your block theme’s setup function in functions.php:
add_theme_support( 'menus' );
Now you can create and add links to your menus on the classic screen. The menus then need to be added to a navigation block. You can think of the navigation block as the “menu location”, that decides the position where your menu shows on your site.