Updated the menu options
authorIan Weller <ian@gaslightmedia.com>
Fri, 13 Jan 2017 20:00:29 +0000 (15:00 -0500)
committerIan Weller <ian@gaslightmedia.com>
Fri, 13 Jan 2017 20:00:29 +0000 (15:00 -0500)
I updated the menu options from what was there originally.

functions.php
parts/off-canvas-menu.php
parts/top-bar.php

index aa939e5..ed18ada 100644 (file)
@@ -23,7 +23,86 @@ if (!function_exists('glm_quicksite_widget_init')) {
     }
 
 }
-
+register_nav_menus(array(
+  'top-bar' => 'Site Navigation',
+  'footer'  => 'Footer Navigation',
+  'second-header' => 'Secondary Header Navigation'
+));
+/**
+ * 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()
+      ));
+  }
+}
+/**
+ * Footer
+ */
+if ( ! function_exists( 'glm_theme_footer' ) ) {
+  function glm_theme_footer() {
+      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' => 'footer',                  // 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()
+      ));
+  }
+}
+/**
+ * Secondary Header Navigation
+**/
+if ( ! function_exists( 'glm_theme_second_header' ) ) {
+  function glm_theme_second_header() {
+      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' => 'second-header',                  // 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()
+      ));
+  }
+}
+/**
+ * Mobile off-canvas
+ */
+if ( ! function_exists( 'glm_theme_mobile_off_canvas' ) ) {
+    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>';
+        echo glm_get_mobile_nav_menu( 'top-bar' );
+        echo glm_get_mobile_nav_menu( 'footer' );
+        echo '</ul></div>';
+    }
+}
 /**
  * get_menu_options
  *
@@ -142,8 +221,8 @@ function glm_get_header() {
     if (has_post_thumbnail()) {
             $image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full");
             echo ' style="background-image: url('.$image_data[0].');height:0;padding:0;padding-bottom:20%;background-position:center center;background-size: 100%;background-repeat:no-repeat;';
-    } else {
-            echo ' style="background-image: url('.get_template_directory_uri().'/assets/default-header.gif);height:0;padding:0;padding-bottom:30%;background-position:center center;background-size: 100%;background-repeat:no-repeat;';
+//    } else {
+//            echo ' style="background-image: url('.get_template_directory_uri().'/assets/default-header.gif);height:0;padding:0;padding-bottom:30%;background-position:center center;background-size: 100%;background-repeat:no-repeat;';
     }
     echo 'max-height: 300px; ">';
     echo '</div>';
index dcbc0d1..23a839d 100644 (file)
@@ -1,5 +1,5 @@
 <aside class="left-off-canvas-menu hide-for-large-up">
-    <?php glm_offcanvas_menu(); ?>
+    <?php glm_theme_mobile_off_canvas(); ?>
     <form class="search text-center">
         <input name="s" type="search" placeholder="Search">
         <a class="magnifying-glass" href="#"></a>
index d154377..34350ba 100644 (file)
@@ -1,6 +1,6 @@
 <nav class="top-bar text-center show-for-large-up" data-topbar role="navigation">
     <section class="top-bar-section">
-        <?php glm_page_menu(); ?>
+        <?php glm_theme_top_bar(); ?>
     </section>
 </nav>
 <nav class="tab-bar show-for-medium-down">