Fixing the is_in_tree check for the off-canvas menu, which was still using the old...
authorLaury GvR <laury@gaslightmedia.com>
Tue, 23 Oct 2018 19:35:59 +0000 (15:35 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 23 Oct 2018 19:35:59 +0000 (15:35 -0400)
lib/navigation.php

index b0c8607..6b58ebc 100644 (file)
@@ -53,12 +53,19 @@ 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>';
-        if(is_in_tree_theme(OWNERS_FRONTPAGE_ID) ){ 
+        global $post;
+        if( is_home() ){
+            $page_id = get_option( 'page_for_posts' );
+        }else{
+            $page_id = $post->ID;
+        }
+
+        if(is_in_tree_theme(OWNERS_FRONTPAGE_ID, $page_id) ): 
             echo glm_get_mobile_nav_menu( 'owners' );
             echo glm_get_mobile_nav_menu( 'top-links' );
-        }else{
+        else:
             echo glm_get_mobile_nav_menu( 'public' );
-        }
+        endif;
         echo '</ul></div>';
     }
 }