Move main menu and add a new menu above header. (1 post)

  1. AJD
    Posted 2 years ago #

    I wanted to move the main menu under the header and add a new menu above the header.

    Here's how:

    First visit this thread to move the menu.

    Then in functions.php (child theme):


    //Register a new menu area.
    register_nav_menu( 'above_header', 'Above Header' );
    //Make sure to create a new menu and assign it to 'Above Header'.
    //Setup the new menu and hook it in. 
    add_action ('highwind_header_before', 'add_highwind_header_menu');
    function add_highwind_header_menu() {
    	$defaults = array(
    	'theme_location'  => 'above_header',
    	'container'       => 'div',
    	'container_class' => 'header-nav',
    	'menu_class'      => 'menu',
    	'fallback_cb'     => 'wp_page_menu',
    	'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>',
    wp_nav_menu( $defaults );

    All you have to do is style it. Here's a bit to get started:

    .header-nav ul.menu {  padding-top: 0;}
    .header-nav ul.menu li {  display: block;  float: left;  list-style: none outside none;  position: relative;}
    .header-nav ul.menu a {  -moz-box-sizing: border-box;  display: inline-block; padding: 0.844em 1.125em;  text-decoration: none; }


Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic