adding blocks for chamber page
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 22 Apr 2016 17:29:22 +0000 (13:29 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 22 Apr 2016 17:29:22 +0000 (13:29 -0400)
functions.php
parts/glm-blocks.php

index db72134..dae1c7c 100644 (file)
@@ -7,6 +7,9 @@ $includePages = array();
 $frontPageId  = get_option('page_on_front');
 add_action('widgets_init', 'glm_quicksite_widget_init');
 
+define("CHAMBER_BLOCKS", 771);
+define("DEFAULT_BLOCKS", 772);
+
 if (!function_exists('glm_quicksite_widget_init')) {
 
     function glm_quicksite_widget_init()
index fb1d1b5..00ebe63 100644 (file)
@@ -1,5 +1,19 @@
 <?php if(function_exists('fetch_all_glm_blocks')):?>
-<?php $blocks = fetch_all_glm_blocks();?>
+<?php 
+$page_template = get_page_template_slug($post->ID);
+switch ($page_template) {
+case 'front-page.php':
+    $defaultBlockGroup = DEFAULT_BLOCKS;
+    break;
+case 'chamber-template.php':
+    $defaultBlockGroup = CHAMBER_BLOCKS;
+    break;
+default:
+    $defaultBlockGroup = DEFAULT_BLOCKS;
+    break;
+}
+?>
+<?php $blocks = fetch_all_glm_blocks($defaultBlockGroup);?>
 <?php $count = 1; ?>
 <div class="blocks">
     <?php foreach ($blocks as $block):?>