Adding mobile off-canvas functions for the separate sections
authorLaury GvR <laury@gaslightmedia.com>
Wed, 21 Feb 2018 16:42:32 +0000 (11:42 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Wed, 21 Feb 2018 16:42:32 +0000 (11:42 -0500)
index.php
lib/navigation.php
sections/off-canvas.php

index 6bc20a6..a1bcc89 100644 (file)
--- a/index.php
+++ b/index.php
@@ -41,7 +41,7 @@
                         include "sections/front-page-header.php";
                         include "sections/front-page.php";
                     } else {
-                        include "sections/header.php";
+                            include "sections/header.php";                        
                         if (is_home() || is_page($GLOBALS['entity_page_slug']."-news")) {
                             include "sections/blog-home.php";
                         } else if (is_archive()) {
index 0cb81c2..1f74fc7 100644 (file)
@@ -40,6 +40,98 @@ if ( ! function_exists( 'glm_theme_top_bar' ) ) {
   }
 }
 
+if ( ! function_exists( 'government_mobile_off_canvas' ) ) {
+  function river_mobile_off_canvas() {
+      echo '<ul class="left-off-canvas-list">';
+      echo '<li class="page_item"><a href="' . get_bloginfo('url') . '">Home</a></li>';
+      echo '<h3 class="propertyLabel"> Government </h3>';
+      wp_nav_menu(array(
+          'container' => false,                           // remove nav container
+          'container_class' => '',                        // class of container
+          'menu' => '',                                   // menu name
+          'menu_class' => 'government',                             // adding custom nav class
+          'theme_location' => 'government-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 Feature_Offcanvas_Walker()
+      ));
+      echo '</ul>';
+  }
+}
+
+if ( ! function_exists( 'chamber_mobile_off_canvas' ) ) {
+  function river_mobile_off_canvas() {
+      echo '<ul class="left-off-canvas-list">';
+      echo '<li class="page_item"><a href="' . get_bloginfo('url') . '">Home</a></li>';
+      echo '<h3 class="propertyLabel"> Chamber of Commerce </h3>';
+      wp_nav_menu(array(
+          'container' => false,                           // remove nav container
+          'container_class' => '',                        // class of container
+          'menu' => '',                                   // menu name
+          'menu_class' => 'chamber',                             // adding custom nav class
+          'theme_location' => 'chamber-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 Feature_Offcanvas_Walker()
+      ));
+      echo '</ul>';
+  }
+}
+
+if ( ! function_exists( 'visitors_mobile_off_canvas' ) ) {
+  function river_mobile_off_canvas() {
+      echo '<ul class="left-off-canvas-list">';
+      echo '<li class="page_item"><a href="' . get_bloginfo('url') . '">Home</a></li>';
+      echo '<h3 class="propertyLabel"> Visitor Information </h3>';
+      wp_nav_menu(array(
+          'container' => false,                           // remove nav container
+          'container_class' => '',                        // class of container
+          'menu' => '',                                   // menu name
+          'menu_class' => 'visitors',                             // adding custom nav class
+          'theme_location' => 'visitors-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 Feature_Offcanvas_Walker()
+      ));
+      echo '</ul>';
+  }
+}
+
+if ( ! function_exists( 'economic_mobile_off_canvas' ) ) {
+  function river_mobile_off_canvas() {
+      echo '<ul class="left-off-canvas-list">';
+      echo '<li class="page_item"><a href="' . get_bloginfo('url') . '">Home</a></li>';
+      echo '<h3 class="propertyLabel"> Economic Development </h3>';
+      wp_nav_menu(array(
+          'container' => false,                           // remove nav container
+          'container_class' => '',                        // class of container
+          'menu' => '',                                   // menu name
+          'menu_class' => 'economic',                             // adding custom nav class
+          'theme_location' => 'river-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 Feature_Offcanvas_Walker()
+      ));
+      echo '</ul>';
+  }
+}
+
 /**
  * Government Navigation
  */
index 7334bd2..30d557e 100644 (file)
@@ -6,24 +6,24 @@
 </div>
 <div class="off-canvas position-left opensearchserver.ignore" id="offCanvasLeft" data-off-canvas>
 <?php 
-//    switch($GLOBALS['entity_page_slug']){
-//        case "government":
-//           glm_theme_mobile_off_canvas('gov-nav'); 
-//            break;
-//        case "chamber-of-commerce":
-//            glm_theme_mobile_off_canvas('chamber-nav'); 
-//            break;
-//        case "convention-visitors-bureau":
-//            glm_theme_mobile_off_canvas('cvb-nav'); 
-//            break;
-//        case "edc":
-//            glm_theme_mobile_off_canvas('edc-nav'); 
-//            break;
-//        default:
-//             glm_theme_mobile_off_canvas('top-bar'); 
-//            break;
-//    }
-    glm_theme_mobile_off_canvas('top-bar'); 
+    switch($GLOBALS['entity_page_slug']){
+        case "government":
+           glm_theme_mobile_off_canvas('government-nav'); 
+            break;
+        case "chamber-of-commerce":
+            glm_theme_mobile_off_canvas('chamber-nav'); 
+            break;
+        case "convention-visitors-bureau":
+            glm_theme_mobile_off_canvas('visitors-nav'); 
+            break;
+        case "edc":
+            glm_theme_mobile_off_canvas('economic-nav'); 
+            break;
+        default:
+             glm_theme_mobile_off_canvas('top-bar'); 
+            break;
+    }
+    
 ?>
     
     <?php glm_page_menu(0, 'vertical dropdown menu',186); ?>