<?php
register_nav_menus(array(
- 'top-bar' => 'Site Navigation'
+ 'top-bar-1' => 'Top Nav One',
+ 'top-bar-2' => 'Top Nav Two',
+ 'top-bar-3' => 'Top Nav Three',
+ 'top-bar-4' => 'Top Nav Four',
+ 'top-bar-5' => 'Top Nav Five',
+ 'top-bar-6' => 'Top Nav Six'
));
/**
* Top Bar
*/
if ( ! function_exists( 'glm_theme_top_bar' ) ) {
- function glm_theme_top_bar() {
- wp_nav_menu(array(
- 'container' => false, // remove nav container
- 'container_class' => '', // class of container
- 'menu' => '', // menu name
- 'menu_class' => '', // adding custom nav class
- 'theme_location' => 'top-bar', // where it's located in the theme
- 'before' => '', // before each link <a>
- 'after' => '', // after each link </a>
- 'link_before' => '', // before each link text
- 'link_after' => '', // after each link text
- 'depth' => 3, // limit the depth of the nav
- 'fallback_cb' => false, // fallback function (see below)
- 'walker' => new Glm_Theme_Top_Bar_Walker()
- ));
- }
+ function glm_theme_top_bar() {
+ echo '<ul>';
+ echo glm_get_top_bar_nav_menu( 'top-bar-1' );
+ echo glm_get_top_bar_nav_menu( 'top-bar-2' );
+ echo glm_get_top_bar_nav_menu( 'top-bar-3' );
+ echo glm_get_top_bar_nav_menu( 'top-bar-4' );
+ echo glm_get_top_bar_nav_menu( 'top-bar-5' );
+ echo glm_get_top_bar_nav_menu( 'top-bar-6' );
+ echo '</ul>';
+ }
+}
+
+function glm_get_top_bar_nav_menu( $theme_location )
+{
+ $menu = wp_nav_menu(array(
+ 'echo' => false, // don't echo
+ 'container' => false, // remove nav container
+ 'container_class' => '', // class of container
+ 'menu' => '', // menu name
+ 'menu_class' => '', // adding custom nav class
+ 'theme_location' => $theme_location, // where it's located in the theme
+ 'before' => '', // before each link <a>
+ 'after' => '', // after each link </a>
+ 'link_before' => '', // before each link text
+ 'link_after' => '', // after each link text
+ 'depth' => 3, // limit the depth of the nav
+ 'fallback_cb' => false, // fallback function (see below)
+ 'walker' => new Glm_Theme_Top_Bar_Walker()
+ ));
+ return preg_replace( array( '%^<ul[^>]*>%', '%</ul>$%' ), '', $menu );
}
/**
function glm_theme_mobile_off_canvas() {
echo '<div class="left-off-canvas-list">';
echo '<ul><li class="page_item"><a href="' . get_bloginfo('url') . '">Home</a></li>';
- wp_nav_menu(array(
- 'container' => false, // remove nav container
- 'container_class' => '', // class of container
- 'menu' => '', // menu name
- 'menu_class' => 'off-canvas-list', // adding custom nav class
- 'theme_location' => 'top-bar', // where it's located in the theme
- 'before' => '', // before each link <a>
- 'after' => '', // after each link </a>
- 'link_before' => '', // before each link text
- 'link_after' => '', // after each link text
- 'depth' => 5, // limit the depth of the nav
- 'fallback_cb' => false, // fallback function (see below)
- 'walker' => new Glm_Theme_Off_Canvas_Walker()
- ));
+ echo glm_get_mobile_nav_menu( 'top-bar-1' );
+ echo glm_get_mobile_nav_menu( 'top-bar-2' );
+ echo glm_get_mobile_nav_menu( 'top-bar-3' );
+ echo glm_get_mobile_nav_menu( 'top-bar-4' );
+ echo glm_get_mobile_nav_menu( 'top-bar-5' );
+ echo glm_get_mobile_nav_menu( 'top-bar-6' );
echo '</ul></div>';
}
}
+function glm_get_mobile_nav_menu( $theme_location )
+{
+ $menu = wp_nav_menu(array(
+ 'echo' => false, // don't echo
+ 'container' => false, // remove nav container
+ 'container_class' => '', // class of container
+ 'menu' => '', // menu name
+ 'menu_class' => 'off-canvas-list', // adding custom nav class
+ 'theme_location' => $theme_location, // where it's located in the theme
+ 'before' => '', // before each link <a>
+ 'after' => '', // after each link </a>
+ 'link_before' => '', // before each link text
+ 'link_after' => '', // after each link text
+ 'depth' => 5, // limit the depth of the nav
+ 'fallback_cb' => false, // fallback function (see below)
+ 'walker' => new Glm_Theme_Off_Canvas_Walker()
+ ));
+ return preg_replace( array( '%^<ul[^>]*>%', '%</ul>$%' ), '', $menu );
+}
+
/**
* Footer
*/