adding new off canvas menu for regions categories
authorAnthony Talarico <talarico@gaslightmedia.com>
Wed, 2 Nov 2016 15:26:24 +0000 (11:26 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Wed, 2 Nov 2016 15:26:24 +0000 (11:26 -0400)
lib/navigation.php
parts/off-canvas-menu.php

index 96d583b..e634ae0 100644 (file)
@@ -1,7 +1,8 @@
 <?php
 
 register_nav_menus(array(
-  'top-bar' => 'Site Navigation'
+  'top-bar' => 'Site Navigation',
+  'regions' => 'Regions'
 ));
 
 /**
@@ -37,6 +38,17 @@ if ( ! function_exists( 'glm_theme_mobile_off_canvas' ) ) {
         echo '</ul></div>';
     }
 }
+/**
+ * Mobile off-canvas
+ */
+if ( ! function_exists( 'glm_regions_mobile_off_canvas' ) ) {
+    function glm_regions_mobile_off_canvas() {
+        echo '<div class="left-off-canvas-list">';
+        echo '<ul><li class="page_item"><a href="' . home_url() . '">Home</a></li>';
+        echo glm_get_mobile_nav_menu( 'regions' );
+        echo '</ul></div>';
+    }
+}
 
 function glm_get_mobile_nav_menu( $theme_location )
 {
index 4900aec..4a86310 100644 (file)
@@ -1,5 +1,6 @@
 <aside class="left-off-canvas-menu hide-for-large-up">
     <?php glm_theme_mobile_off_canvas(); ?>
+    <?php glm_regions_mobile_off_canvas(); ?>
 <!--    <?php get_template_part('parts/search');?>-->
     <ul class="offcavas-social-list">
         <li><a class="facebook" href="https://www.facebook.com/FranceJourneysTravel/" target="_blank"></a></li>