Add second navigationmenu


#1

Is it possible to add a second navigationmenu on top of the page? Instead of the social menu?

Thanks in advance!

http://hafentv.mikevanoverveld.nl


#2

Hi, it is possible, although it requires theme modifications. It would be wise to use child theme because on next theme update you will lose your changes.

First you should register new navigation, in functions.php change this line:

register_nav_menus( array(
		'primary' => __( 'Primary Menu', 'solon' ),
		'social' => __( 'Social', 'solon' ),
	) );

to

register_nav_menus( array(
		'primary' => __( 'Primary Menu', 'solon' ),
		'secondary' => __( 'Secondary Menu', 'solon' ),
		'social' => __( 'Social', 'solon' ),
	) );

Second, call newly created navigation in header.php, after social navigation:

<?php if ( has_nav_menu( 'social' ) ) : ?>
		<nav class="social-navigation clearfix">
			<?php wp_nav_menu( array( 'theme_location' => 'social', 'link_before' => '<span class="screen-reader-text">', 'link_after' => '</span>', 'container_class' => 'container', 'menu_class' => 'menu clearfix', 'fallback_cb' => false ) ); ?>
		</nav>
	<?php endif; ?>

After this <?php endif; ?> you should place your navigation, like this:

<nav class="secind-navigation" role="navigation">
		<div class="container">
			<?php wp_nav_menu( array( 'theme_location' => 'secondary' ) ); ?>
		</div>
	</nav><!-- #site-navigation -->

Or just delete social navigation and place yours instead.

Depending of how you set your navigation it will need some CSS styling. After you set navigation post here again if you need some help with styling.