Back

Wordpress PHP

Adding a separate nav to somewhere else in the template.

In your header.php, add in this code

<?php

$defaults = array(
    'theme_location'  => '',
    'menu'            => 'Name Of The Menu',
    'container'       => ‘nav’,
    'container_class' => '',
    'container_id'    => '',
    'menu_class'      => 'menu',
    'menu_id'         => '',
    'echo'            => true,
    'fallback_cb'     => 'wp_page_menu',
    'before'          => '',
    'after'           => '',
    'link_before'     => '',
    'link_after'      => '',
    'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>',
    'depth'           => 0,
    'walker'          => ''
);
wp_nav_menu( $defaults );

?>
      

For 'Name Of The Menu' add the name of your menu.