Adding a secondary horizontal menu
-
Hi
I am looking a way to add a horizontal secondary menu in my theme. I have tried adding
add_action( 'init', 'register_secondary_menu' ); function register_secondary_menu() { if ( function_exists( 'register_nav_menu' ) ) { register_nav_menu( 'secondary-menu', 'Secondary Menu' ); } } add_action('__header', 'display_secondary_menu', 1000, 0); function display_secondary_menu() { echo ( has_nav_menu( 'secondary-menu' ) ? wp_nav_menu ( array ( 'theme_location' => 'secondary-menu', 'container_id' => 'secondary-menu', 'container_class' => 'secondary-menu' ) ).'<div class="clearall"></div>' : '' ); }
in my child theme. This has created a new menu location. But when I assign some menu to that location it is still not displayed.
I am using twentyFourteen theme on a localhost PC
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Adding a secondary horizontal menu’ is closed to new replies.