Answer the question
In order to leave comments, you need to log in
Why doesn't the new menu appear in the wordpress admin?
Greetings. There is a shop on wordpress woocomerce. I want to add my menu to the topic. I add the code to the functions.php file:
function register_my_menu()
{
register_nav_menu
(
array( 'header-menu' => 'header-menu1')
);
}
if (function_exists('register_nav_menu'))
{
add_action( 'init', 'register_my_menu' );
}
<nav>
<?php wp_nav_menu( array( 'theme_location' => 'header-menu' ) ); ?>
</nav>
Answer the question
In order to leave comments, you need to log in
Try changing the function code to:
function theme_register_nav_menu() {
register_nav_menu( 'header-menu', 'Моё супер-меню' );
}
add_action( 'after_setup_theme', 'theme_register_nav_menu' );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question