I am currently trying to add specific menus to the page for HTML5 blank theme. I created new positions via the following code in functions.php
// Register HTML5 Blank Navigation
function register_html5_menu()
{
register_nav_menus(array( // Using array to specify more menus if needed
'header-menu' => __('Header Menu', 'html5blank'), // Main Navigation
'sidebar-menu' => __('Sidebar Menu', 'html5blank'), // Sidebar Navigation
'motor-vehicles-menu' => __('Motor vehicles menu', 'html5blank'),
'salvage-menu' => __('Salvage Menu', 'html5blank'),
'general-goods-menu' => __('General goods Menu', 'html5blank'),
'industrial-menu' => __('Industrial Menu', 'html5blank'), // Extra Navigation if needed (duplicate as many as you need!)
'about-menu-menu' => __('About Menu', 'html5blank') // Extra Navigation if needed (duplicate as many as you need!)
));
}
I have then went it the admin via menu section and created the menu for salvage position
I then go to my theme and try to present the menu using the following:
<?php html5blank_nav( array( 'theme_location' => 'salvage-menu') ); ?>
I am not sure how exactly how to make this work. Any help would be great.
Thanks
That’s not how you show your menu in your files.
You’ve registered them, and this works (you can see them in admin), but you need wp_nav_menu() function to display the menu. For instance:
Hope this helps 🙂
There are two steps for creating a menu/widget/plugin.
functions.php
.Step 1: Writing functionality in
functions.php
.Step 2:
Register and call your newly created function from theme.