Support » Fixing WordPress » Display Nav Menus when Theme only allows 1

  • I’ve defined 2 nav menus in WP dashboard and assigned one of them to the Primary Menu. My theme only allows for one menu (in the dashboard), but I still want to access and display the second one. How do I do that and display as I’ve set it up in the dashboard?

    I can hardcode it, of course, but I was trying to make it more flexible.

    Thanks, Tonya

Viewing 1 replies (of 1 total)
  • Thread Starter tjbrewers

    (@tjbrewers)

    Woohoo I figured it out. Here’s the code I used:

    <?php //title attribute gets in the way - remove it
                          $menu = wp_nav_menu( array( 'menu' => 'Main Menu', 'container' => 'div', 'fallback_cb' => 'wp_page_menu', 'container_class' => 'menu', 'echo' => '0' ) );
                          $menu = preg_replace('/title=\"(.*?)\"/','',$menu);
                          echo $menu;
                       ?>

Viewing 1 replies (of 1 total)
  • The topic ‘Display Nav Menus when Theme only allows 1’ is closed to new replies.