Two Horizontal Menu Bars in Custom Theme
-
Hello,
I am trying to create two horizontal menu bars so that I can have two languages on this website (German and English). http://www.artboxcouture.com/
I have created both menus in the menu section in the wordpress admin panel and added this function to my functions.php file.
/ Create a function for register_nav_menus() function add_wp3menu_support() { register_nav_menus( array( 'main-menu' => __('Main Navigation'), 'another-menu' => __('Another Navigation') ) ); }The German menu is primary and is displaying on the website. I would the the ‘another navigation’ menu or the English menu to appear once the user clicks on English and then on all of the English pages. I am not quire sure what needs to be added to functions.php and/or header.php for this to happen. Here is what I have though:
functions.php:
add_action('init', 'add_wp3menu_support'); function show_menu() { if ( is_page('English') ) { if ( has_nav_menu( 'another-menu' ) ) { wp_nav_menu( array( 'theme_location' => 'another-menu' ) ); } } }header.php:
<?php wp_nav_menu( array( 'theme_location' => 'main-menu', // Setting up the location for the main-menu, Main Navigation. 'menu_class' => 'dropdown', //Adding the class for dropdowns 'container_id' => 'navwrap', //Add CSS ID to the containter that wraps the menu. 'fallback_cb' => 'wp_page_menu', //if wp_nav_menu is unavailable, WordPress displays wp_page_menu function, which displays the pages of your blog. ) ); ?>Thank you for your help!
The topic ‘Two Horizontal Menu Bars in Custom Theme’ is closed to new replies.