The standard method of registering a menu with WordPress consists in adding this to functions.php:

function register_menu() {
  register_nav_menu('main_menu', 'Main Menu');
}
add_action('init', 'register_menu');

But why not simply calling register_nav_menu() from functions.php without hooking anything?

register_nav_menu('main_menu', 'Main Menu');

It works fine too so why bother?

Read more here: What’s the point of hooking register_nav_menu to "init" rather than calling it directly?


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: