Update menu for off canvas
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 18 Oct 2016 18:55:30 +0000 (14:55 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 18 Oct 2016 18:55:30 +0000 (14:55 -0400)
Move the home menu so it's on the top.

lib/navigation.php

index 282a56c..13caab2 100644 (file)
@@ -14,7 +14,7 @@ if ( ! function_exists( 'glm_theme_top_bar' ) ) {
         echo glm_theme_top_bar_nav( 'top-bar' );
         echo '</ul>';
     }
-    
+
   function glm_theme_top_bar_nav($theme_location) {
     $menu = wp_nav_menu(array(
         'echo'            => false,             // don't echo
@@ -40,7 +40,7 @@ if ( ! function_exists( 'glm_theme_top_bar' ) ) {
  */
 if ( ! function_exists( 'glm_theme_mobile_off_canvas' ) ) {
     function glm_theme_mobile_off_canvas() {
-        echo '<ul class="vertical dropdown menu" data-dropdown-menu><li class="page_item"><a href="' . get_bloginfo('url') . '">Home</a></li>';
+        echo '<ul class="vertical dropdown menu" data-dropdown-menu>';
         echo glm_get_mobile_nav_menu( 'top-bar' );
         echo '</ul>';
     }
@@ -74,13 +74,13 @@ if ( ! function_exists( 'glm_theme_footer' ) ) {
 
       echo '<ul class="menu text-center">';
       echo glm_get_footer_nav_menu( 'footer' );
-      
+
       echo '<li class="menu-item menu-item-type-post_type menu-item-object-page">';
       echo '<div id="weather-widget"> '. do_shortcode('[wunderground location="Three Oaks, MI" measurement="f" layout="table-horizontal" numdays="1" showdata="alerts,daynames,pop,icon,conditions,date,highlow"]') . '</div>';
       echo '<a href="https://www.wunderground.com/q/zmw:49128.1.99999" target="_blank" id="activate-weather">Weather</a></li>';
       echo '</ul>';
   }
-  function glm_get_footer_nav_menu( $theme_location ){    
+  function glm_get_footer_nav_menu( $theme_location ){
      $menu = wp_nav_menu(array(
           'echo' => false,
           'container' => false,                           // remove nav container
@@ -123,6 +123,7 @@ function glm_page_menu($parent = 0, $class = '',$page_ids = [])
     }
     $pages = get_pages($args);
     echo '<ul'.(($class)?' class="'.$class.'"':'').'><!-- begin -->'."\n";
+    echo '<li class="page_item"><a href="' . get_bloginfo('url') . '">Home</a></li>';
     foreach ($pages as $page) {
         $childs = get_pages('child_of=' . $page->ID);
         if (count($childs) > 0) {