How Do I Create a Hidden Menu in WordPress?

Creating a hidden menu in WordPress is relatively easy. Once you have created your menu, all you need to do is add a few lines of code to your theme’s functions.

php file. Here’s how to do it:.

1. Open your theme’s functions.php file and add the following code below the line that defines your theme’s main() function:

function hidden_menu() { register_sidebar(array(‘name’ => ‘My Menu’, ‘id’ => ‘my-menu’)); }

2. Next, add the following line to your theme’s header.php file: