Second Menu on Travelify

Hello - I’m trying to read old threads to add a second menu but I’m at a standstill.

I was able to add this code to the functions.php file and I can now see a “Secondary” menu in my Wordpress admin:
register_nav_menu( ‘secondary’, __( ‘Secondary Menu’, ‘travelify’ ) );

But I’m not sure what I do next to make it show up on the site. What code do I add and in what file?

Thanks!
Jamie

Now that you have this menu registered you have to add it in website. The current header menu is added in header-extensions.php file which you can find in theme folder - library - structure.

Code related to WordPress menu is like this:

<?php
		if ( has_nav_menu( 'primary' ) ) { 
			$args = array(
				'theme_location'    => 'primary',
				'container'         => '',
				'items_wrap'        => '<ul class="root">%3$s</ul>' 
			);
			echo '<nav id="main-nav" class="clearfix">
					<div class="container clearfix">';
				wp_nav_menu( $args );
			echo '</div><!-- .container -->
					</nav><!-- #main-nav -->';
		}
		else {
			echo '<nav id="main-nav" class="clearfix">
					<div class="container clearfix">';
				wp_page_menu( array( 'menu_class'  => 'root' ) );
			echo '</div><!-- .container -->
					</nav><!-- #main-nav -->';
		}
	?> 		

You can use this code as a base for new menu but you might have to applying some extra styling to it as well.

Sorry, I’m still getting used to the structure of WP themes … can I copy this code exactly or should I chance “primary” to “secondary”? I tried adding into my header-extension file but I got an error … I want this menu to appear above all the content, right underneath the solid decorative bar that spans the top of the template.

Thanks so much!

Ok, then you need some tweaks.

Take this code

		<?php
		if ( has_nav_menu( 'secondary' ) ) {
			$args = array(
				'theme_location'    => 'secondary',
				'container'         => '',
				'items_wrap'        => '<ul class="root">%3$s</ul>'
			);
			echo '<nav id="main-nav" class="clearfix">
					<div class="container clearfix">';
				wp_nav_menu( $args );
			echo '</div><!-- .container -->
					</nav><!-- #main-nav -->';
		}
		else {
			echo '<nav id="main-nav" class="clearfix">
					<div class="container clearfix">';
				wp_page_menu( array( 'menu_class'  => 'root' ) );
			echo '</div><!-- .container -->
					</nav><!-- #main-nav -->';
		}
	?>

And add it directly into header.php right after closing header tag </head> Now you should see your menu fully functional right underneath the solid line.

That worked perfectly! I just had to copy over the css for “main-nav” to edit the style separately from the primary nav. Thank you SO much! Now this theme works perfectly for me.

OMG! I love you guys. That´s is what I needed, but a little different.

Firstly, let me say that I´ve been reading several questions and you are always answering them. You´re awesome Aigars! If you ever need help with Brazilian Portuguese translation, just let me know and I´ll tell you how to reach me.

I did what you guys talked about on this page and it worked. But the menu is in a vertical list and with those “topic dots”.

Well, I want to change it so it´s horizontal and with no topic dots. Also, if possible, I want to make some items on the menu to have a submenu drop-down when you point to it. (Most specifically, I want the “store” link to show the product categories when you point to it. Is it too hard to do?

P.S.: I´m using the dazzling theme and just had to change the travelify for dazzling.

Thanks!

Also, although this is not too important (but it would be nice), the glyphicons don´t work for that menu. Is it possible to have it?

I am interested in adding a second menu as well!! In particular I am trying to add a menu in the top right corner, even above the header space area where the logo and social icons go.

For a “about, home, contact” section. Please help :smiley:

Also, if there is a way to put a search bar in the place where the social media icons go in the header I’d love to know that as well!!

Thanks

@ahlegarcia This is old topic so to help us keep support thread separates could you please create your own thread for your question here https://colorlibsupport.com/c/travelify-support/ instead of replying on others thread as it makes the thread messy and hard to read.

If you want to you can also add reference of this thread in your newly created thread.

We would be more than happy to help you on your new thread.