Archived

This topic is now archived and is closed to further replies.

  • 0

How to move primary nav to header area

Question

Posted · Report post

Can I have a simple function that moves primary nav to header/branding area? I am trying this:

add_action('pagelines_before_branding_icons', 'add_topnav_menu');
	function add_topnav_menu() {
		wp_nav_menu( array('menu' => '$menu' ));
	}
	

and it posts the nav bar inside header, but it loses all CSS and so, display it vertically. How can we keep intact the entire nav bar?

Share this post


Link to post
Share on other sites

3 answers to this question

Posted · Report post

Forwarded to developers. Thanks, Bryan

Share this post


Link to post
Share on other sites

Posted · Report post

Hmm... well it looks like you're getting there... There are two good approaches to this. 1. Use a hook (like you did ) 2. Create a custom section (in the child theme) ** To get the styling you're looking for you're going to need to apply the same CSS classes given in the section.nav.php file. namely: `wp_nav_menu( array('menu_class' => 'main-nav'.$additional_menu_classes, 'container' => null, 'container_class' => '', 'depth' => 3, 'theme_location'=>'primary', 'fallback_cb'=>'nav_fallback') );` just start by using that with your hook :)

Share this post


Link to post
Share on other sites