Jump to content
Sign in to follow this  
buzzdeep

How to move primary nav to header area

Recommended Posts

buzzdeep    0
buzzdeep

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
bryan-hadaway    3
bryan-hadaway

Forwarded to developers. Thanks, Bryan

Share this post


Link to post
Share on other sites
Andrew    201
Andrew

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×