working on template problem
authorIan Weller <ian@gaslightmedia.com>
Thu, 15 Sep 2016 15:09:26 +0000 (11:09 -0400)
committerIan Weller <ian@gaslightmedia.com>
Thu, 15 Sep 2016 15:09:26 +0000 (11:09 -0400)
I am having some issues with the template page.  I think with the help I
just got it should be fixed.

functions.php
page-chamber.php [deleted file]
sections/interior-page.php

index aa5079e..e99f1a7 100644 (file)
@@ -211,7 +211,7 @@ add_filter( 'custom_page_templates', function( $now_templates ) {
     // this template by its slug in our index.php using get_page_template_slug
     // Below are some commented examples of custom quasi-templates.
     $templates = array(
-    //    'some-custom-page-template' => 'Some Custom Page Template',
+       'page-chamber'       => 'Chamber Page'
     //    'any-template-slug' => 'Sample Template' ,
     );
 
diff --git a/page-chamber.php b/page-chamber.php
deleted file mode 100644 (file)
index 97ea06c..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-/*
-Template Name: Chamber Page
-*/
-?>
-<!doctype html>
-<html class="no-js" lang="en">
-    <?php get_template_part("parts/header-meta"); ?>
-    <?php $index_template = true;?>
-    <body>
-        <div class="off-canvas-wrapper">
-            <div class="off-canvas-wrapper-inner" data-off-canvas-wrapper>
-                <div class="off-canvas-content" data-off-canvas-content>
-                    <?php
-                    include "sections/header.php";
-                    echo "<main class=\"page-inside chamber\">";
-                        echo "<div class=\"row\">";
-                            echo "<div class=\"small-12 medium-4 large-3 columns\">";
-                                get_template_part('parts/chamber-sidebar-left');
-                            echo "</div>";    
-                            echo "<div class=\"small-12 medium-8 large-9 columns\">";
-                                get_template_part('parts/main-content');
-                            echo "</div>";
-                            
-                        echo "</div>";
-                    echo "</main>"
-                    include "sections/footer.php";  
-                    include "sections/copyright.php";  
-                    ?>
-                    <div class="js-off-canvas-exit"></div>
-                </div><!--/.off-canvas-content-->
-            </div><!--End of inner-wrap-->
-        </div><!--End of off-canvas-->
-        <?php wp_footer();?>
-    </body>
-</html>
\ No newline at end of file
index 6f60bfd..c9ed630 100644 (file)
             ?>
         </div>
           <div class="row">
-            <?php if(!is_front_page()) {
-                echo "<div class=\"small-12 medium-8 large-9 columns\">";
-                get_template_part('parts/main-content');
-                echo "</div>";
-                echo "<div id=\"sidebar\" class=\"small-12 medium-4 large-3 columns\">";
-                get_sidebar();
-                echo "</div>";
-            }
-            ?>
+              <?php if (get_page_template_slug( $post->ID ) == "page-chamber") { ?>
+                   
+                    <?php $index_template = false; ?>
+                    <main class="page-inside">
+                        <div class="row">
+                            <div class="small-12 medium-4 large-3 columns">
+                                get_template_part('parts/chamber-sidebar-left')
+                            </div>    
+                            <div class="small-12 medium-8 large-9 columns">
+                                get_template_part('parts/main-content')
+                            </div>
+                        </div>
+                    </main>
+                   
+            <!-- check for chamber page template -->
+            <?php } else { ?>
+                <?php if(!is_front_page()) {
+                    echo "<div class=\"small-12 medium-8 large-9 columns\">";
+                    get_template_part('parts/main-content');
+                    echo "</div>";
+                    echo "<div id=\"sidebar\" class=\"small-12 medium-4 large-3 columns\">";
+                    get_sidebar();
+                    echo "</div>";
+                } ?>
+              <?php } ?>
         </div>
     </div>
 </main>
\ No newline at end of file