changed sidebar to use appearance menu instead of pages
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 16 Feb 2016 19:32:32 +0000 (14:32 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 16 Feb 2016 19:32:32 +0000 (14:32 -0500)
lib/navigation.php

index f0843f6..ec10e50 100644 (file)
@@ -37,6 +37,25 @@ if ( ! function_exists( 'glm_theme_mobile_off_canvas' ) ) {
         echo '</ul></div>';
     }
 }
+function glm_get_sidebar_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'           => 1,                 // 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 );
+}
 function glm_get_mobile_nav_menu( $theme_location )
 {
     $menu = wp_nav_menu(array(
@@ -157,7 +176,9 @@ function glm_side_menu() {
     }
     echo '<h2>'.get_the_title($ID).'</h2>';
     echo '<ul class="sidebar"><!-- begin -->'."\n";
-    echo wp_list_pages( 'child_of='.$ID.'&title_li=&depth=1&echo=0');
+//    echo wp_list_pages( 'child_of='.$ID.'&title_li=&depth=1&echo=0');
+    echo glm_get_sidebar_menu( 'top-bar' );
+
     echo '</ul><!-- end -->'."\n";
 }