Merging Two Menus into one UL in Wordpress


/ Published in: PHP
Save to your folder(s)

Pulls in 'main-navigation' and 'social-navigation' menus into a single UL. the key is items_wrap => %3$s


Copy this code and paste it in your HTML
  1. <nav id="main_navigation">
  2. <ul>
  3. <?php wp_nav_menu( array( 'theme_location' => 'main-navigation', 'container' => '', 'container_id' => 'main_navigation', 'items_wrap' => '%3$s' ) ); ?>
  4. <?php wp_nav_menu( array( 'theme_location' => 'social-navigation', 'container' => '', 'container_id' => 'social_navigation', 'items_wrap' => '%3$s' ) ); ?>
  5. </ul>
  6. </nav>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.