how-to-create-wordpress-theme

How to Create WordPress Custom Theme – 4 – Set top & footer navigation menus

Now we need dynamic Menu in top & footer. First register menu positions in theme’s functions.php & create dynamic menus in backend.

In theme functions.php , you have to register the menu first into action hook after_setup_theme. To register the menu use, register_nav_menu() . Now we have to display the menus in front end by putting it in header & footer files. You have to call wp_nav_menu() in header.php & footer.php file to display menus.

register_nav_menu()Registers a navigation menu location for a theme.
wp_nav_menu()Displays a navigation menu.

So at this stage, we have index.php file with some static content. The dynamic page.php file and dynamic navigation menus. Now we are going to create dynamic post.php & front-page.php