added define statements to functions and changed page calling to reference constants
authorAnthony Talarico <talarico@gaslightmedia.com>
Wed, 2 Dec 2015 14:41:53 +0000 (09:41 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Wed, 2 Dec 2015 14:41:53 +0000 (09:41 -0500)
12 files changed:
functions.php
page_art-gallery.php
page_bay-view.php
page_crooked-river.php
page_drawbridge.php
page_perry.php
page_pier.php
page_pointer-boat.php
page_vacation.php
page_weathervane.php
parts/glm-blocks.php
parts/slide-show.php

index d163f4e..5204410 100644 (file)
@@ -2,6 +2,45 @@
 require_once 'lib/menu-walker.php';
 require_once 'lib/navigation.php';
 
+// Page Constants /////////////
+define("DRAWBRIDGE_PAGE", 192 );
+define("DRAWBRIDGE_SLIDER", 48);
+define("DRAWBRIDGE_BLOCKS", 1555);
+
+define("ART_GALLERY_PAGE", 193);
+define("ART_GALLERY_SLIDER", 5881);
+define("ART_GALLERY_BLOCKS", 1556);
+
+define("CROOKED_RIVER_PAGE", 188);
+define("CROOKED_RIVER_SLIDER", 5876);
+define("CROOKED_RIVER_BLOCKS", 77);
+
+define("PIER_PAGE", 190);
+define("PIER_SLIDER", 5878);
+define("PIER_BLOCKS", 78);
+
+define("PERRY_PAGE", 189);
+define("PERRY_SLIDER", 5877);
+define("PERRY_BLOCKS", 118);
+
+define("VACATION_PAGE", 197);
+define("VACATION_SLIDER", 5882);
+define("VACATION_BLOCKS", 1557);
+
+define("BAY_VIEW_PAGE", 187);
+define("BAY_VIEW_SLIDER", 5875);
+define("BAY_VIEW_BLOCKS", 117);
+
+define("WEATHERVANE_PAGE", 191);
+define("WEATHERVANE_SLIDER", 5879);
+define("WEATHERVANE_BLOCKS", 1554);
+
+define("POINTER_BOAT_PAGE", 230);
+define("POINTER_BOAT_SLIDER", 5883);
+define("POINTER_BOAT_BLOCKS", 1558);
+
+define("DEFAULT_BLOCKS", 76);
+define("DEFAULT_SLIDER", 75);
 
 /**
  * Return the client info option for the given key
index b36b45b..c68c462 100644 (file)
@@ -4,7 +4,7 @@ Template Name: Stafford's Art Gallery
 */
 ?>
 <?php get_header(); ?>
-    <?php if (is_page("staffords-art-gallery")) { ?>
+    <?php if (is_page(ART_GALLERY_PAGE)) { ?>
             <header id="art-head">
                 <?php get_template_part('parts/top-bar_art-gallery');?>
                 <?php get_template_part('parts/off-canvas_art-gallery'); ?>
index e29605c..db6ae89 100644 (file)
@@ -4,7 +4,7 @@ Template Name: Bay View Inn
 */
 ?>
 <?php get_header(); ?>
-    <?php if (is_page("bay-view-inn")) { ?>
+    <?php if (is_page(BAY_VIEW_PAGE)) { ?>
             <header id="bay-head">
                 <?php get_template_part('parts/top-bar_bay-view');?>
                 <?php get_template_part('parts/off-canvas_bay-view'); ?>
index edce6f7..6a34379 100644 (file)
@@ -4,7 +4,7 @@ Template Name: Crooked River Lodge
 */
 ?>
 <?php get_header(); ?>
-    <?php if (is_page("crooked-river-lodge")) { ?>
+    <?php if (is_page(CROOKED_RIVER_PAGE)) { ?>
             <header id="crooked-head">
                 <?php get_template_part('parts/top-bar_crooked-river');?>
                 <?php get_template_part('parts/off-canvas_crooked-river'); ?>
index 001d797..b315121 100644 (file)
@@ -4,7 +4,7 @@ Template Name: Drawbridge Bistro
 */
 ?>
 <?php get_header(); ?>
-    <?php if (is_page("drawbridge-bistro")) { ?>
+    <?php if (is_page(DRAWBRIDGE_PAGE)) { ?>
         <header id="drawbridge-head">
             <?php get_template_part('parts/top-bar_drawbridge');?>
             <?php get_template_part('parts/off-canvas_drawbridge');?>
index ca5c046..8d955da 100644 (file)
@@ -4,7 +4,7 @@ Template Name: Perry Hotel
 */
 ?>
 <?php get_header(); ?>
-    <?php if (is_page("perry-hotel")) { ?>
+    <?php if (is_page(PERRY_PAGE)) { ?>
             <header id="perry-head">
                 <?php get_template_part('parts/top-bar_perry');?>
                 <?php get_template_part('parts/off-canvas_perry');?>
index d2dfa8b..221c836 100644 (file)
@@ -4,7 +4,7 @@ Template Name: Pier Restaurant
 */
 ?>
 <?php get_header(); ?>
-    <?php if (is_page("pier-restaurant")) { ?>
+    <?php if (is_page(PIER_PAGE)) { ?>
         <header id="pier-head">
             <?php get_template_part('parts/top-bar_pier');?>
             <?php get_template_part('parts/off-canvas_pier');?>
index f0c587b..778fe67 100644 (file)
@@ -4,7 +4,7 @@ Template Name: The Pointer Boat
 */
 ?>
 <?php get_header(); ?>
-    <?php if (is_page("the-pointer-boat")) { ?>
+    <?php if (is_page(POINTER_BOAT_PAGE)) { ?>
         <header id="boat-head">
             <?php get_template_part('parts/top-bar_pointer-boat');?>
             <?php get_template_part('parts/off-canvas_pointer-boat');?>
index 6f1e94a..0cc68c5 100644 (file)
@@ -4,7 +4,7 @@ Template Name: Vacation Rentals
 */
 ?>
 <?php get_header(); ?>
-    <?php if (is_page("vacation-rentals")) { ?>
+    <?php if (is_page(VACATION_PAGE)) { ?>
         <header id="vacation-head">
             <?php get_template_part('parts/top-bar_vacation');?>
             <?php get_template_part('parts/off-canvas_vacation');?>
index 7ab5059..db44a7e 100644 (file)
@@ -4,7 +4,7 @@ Template Name: Weathervane Restaurant
 */
 ?>
 <?php get_header(); ?>
-    <?php if (is_page("weathervane-restaurant")) { ?>
+    <?php if (is_page(WEATHERVANE_PAGE)) { ?>
         <header id="weathervane-head">
             <?php get_template_part('parts/top-bar_weathervane');?>
             <?php get_template_part('parts/off-canvas_weathervane');?>
index 2dd1d9a..9a68b9e 100644 (file)
@@ -3,37 +3,37 @@
 $page_template = get_page_template_slug($post->ID);
 switch ($page_template) {
 case 'page_about.php':
-    $defaultBlockGroup = 76;
+    $defaultBlockGroup = DEFAULT_BLOCKS;
     break;
 case 'page_art-gallery.php':
-    $defaultBlockGroup = 1556;
+    $defaultBlockGroup = ART_GALLERY_BLOCKS;
     break;
 case 'page_bay-view.php':
-    $defaultBlockGroup = 117;
+    $defaultBlockGroup = BAY_VIEW_BLOCKS;
     break;
 case 'page_crooked-river.php':
-    $defaultBlockGroup = 77;
+    $defaultBlockGroup = CROOKED_RIVER_BLOCKS;
     break;
 case 'page_drawbridge.php':
-    $defaultBlockGroup = 1555;
+    $defaultBlockGroup = DRAWBRIDGE_BLOCKS;
     break;
 case 'page_perry.php':
-    $defaultBlockGroup = 118;
+    $defaultBlockGroup = PERRY_BLOCKS;
     break;
 case 'page_pier.php':
-    $defaultBlockGroup = 78;
+    $defaultBlockGroup = PIER_BLOCKS;
     break;
 case 'page_pointer-boat.php':
-    $defaultBlockGroup = 1558;
+    $defaultBlockGroup = POINTER_BOAT_BLOCKS;
     break;
 case 'page_vacation.php':
-    $defaultBlockGroup = 1557;
+    $defaultBlockGroup = VACATION_BLOCKS;
     break;
 case 'page_weathervane.php':
-    $defaultBlockGroup = 1554;
+    $defaultBlockGroup = WEATHERVANE_BLOCKS;
     break;
 default:
-    $defaultBlockGroup = 76;
+    $defaultBlockGroup = DEFAULT_BLOCKS;
     break;
 }
 ?>
index b176373..427001f 100644 (file)
@@ -3,70 +3,70 @@
     switch ($page_template) {
         case 'page_art-gallery.php':
             echo '<div id="slideshow">';
-            echo do_shortcode("[metaslider id=5881]");
+            echo do_shortcode("[metaslider id=" . ART_GALLERY_SLIDER . "]");
             echo '<div class="gradient"></div>';
             echo '<div class="gradient"></div>';
             echo '</div>'; 
             break;
         case 'page_bay-view.php':
             echo '<div id="slideshow">';
-            echo do_shortcode("[metaslider id=5875]");
+            echo do_shortcode("[metaslider id=" . BAY_VIEW_SLIDER . "]");
             echo '<div class="gradient"></div>';
             echo '<div class="gradient"></div>';
             echo '</div>'; 
             break;
         case 'page_crooked-river.php':
             echo '<div id="slideshow">';
-            echo do_shortcode("[metaslider id=5876]");
+            echo do_shortcode("[metaslider id=" . CROOKED_RIVER_SLIDER . "]");
             echo '<div class="gradient"></div>';
             echo '<div class="gradient"></div>';
             echo '</div>'; 
             break;
         case 'page_drawbridge.php':
             echo '<div id="slideshow">';
-            echo do_shortcode("[metaslider id=5880]");
+            echo do_shortcode("[metaslider id=" . DRAWBRIDGE_SLIDER . "]");
             echo '<div class="gradient"></div>';
             echo '<div class="gradient"></div>';
             echo '</div>'; 
             break;
         case 'page_perry.php':
             echo '<div id="slideshow">';
-            echo do_shortcode("[metaslider id=5877]");
+            echo do_shortcode("[metaslider id=" . PERRY_SLIDER . "]");
             echo '<div class="gradient"></div>';
             echo '<div class="gradient"></div>';
             echo '</div>'; 
             break;
         case 'page_pier.php':
             echo '<div id="slideshow">';
-            echo do_shortcode("[metaslider id=5878]");
+            echo do_shortcode("[metaslider id=" . PIER_SLIDER . "]");
             echo '<div class="gradient"></div>';
             echo '<div class="gradient"></div>';
             echo '</div>'; 
             break;
         case 'page_pointer-boat.php':
             echo '<div id="slideshow">';
-            echo do_shortcode("[metaslider id=5883]");
+            echo do_shortcode("[metaslider id=" . POINTER_BOAT_SLIDER. "]");
             echo '<div class="gradient"></div>';
             echo '<div class="gradient"></div>';
             echo '</div>'; 
             break;
         case 'page_vacation.php':
             echo '<div id="slideshow">';
-            echo do_shortcode("[metaslider id=5882]");
+            echo do_shortcode("[metaslider id=" . VACATION_SLIDER . "]");
             echo '<div class="gradient"></div>';
             echo '<div class="gradient"></div>';
             echo '</div>'; 
             break;
         case 'page_weathervane.php':
             echo '<div id="slideshow">';
-            echo do_shortcode("[metaslider id=5879]");
+            echo do_shortcode("[metaslider id=" . WEATHERVANE_SLIDER . "]");
             echo '<div class="gradient"></div>';
             echo '<div class="gradient"></div>';
             echo '</div>'; 
             break;
         default:
             echo '<div id="slideshow">';
-            echo do_shortcode("[metaslider id=75]");
+            echo do_shortcode("[metaslider id=" . DEFAULT_SLIDER . "]");
             echo do_shortcode("[metaslider id=48]");
             echo '<div class="gradient"></div>';
             echo '<div class="gradient"></div>';