I'm pretty new with wordpress and I want to create my own dropdown menu without the use of any plugins. I have a few questions about this. I already did some research but there are some things i do not understand. In my header file I have the following code for my main menu.
<div id="navigation">
<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
</div>
I didn't have to add any code in my function.php file. It worked well. In the most tutorial, you have to add this code in to the function.php file. But for me it worked without this code.
<?php
add_action( 'init', 'register_my_menus' );
function register_my_menus() {
register_nav_menus(
array(
'main' => __( 'main' ),
));
}
?>
When I want to add a custom menu in wordpress I have to add something to this code.
<?php
add_action( 'init', 'register_my_menus' );
function register_my_menus() {
register_nav_menus(
array(
'main' => __( 'main' ),
**'secondary-menu' => __( 'Secondary Menu' ),**
));
}
?>
From this moment on, i can see 3 menu's in the backend. (2X primary menu, 1X secundary menu) I know this was a lot but I have tried to be clear and i hope somebody will understand me. Can somebody please tell me where i'm going wrong? Thanks