adding check for the page slug to choose the event category
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 27 Jul 2017 18:45:56 +0000 (14:45 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 27 Jul 2017 18:45:56 +0000 (14:45 -0400)
event categories are added to the events shortcode in the sidebar based on the page slug

index.php
parts/event-feed.php
parts/glm-blocks.php
sections/entity-landing.php

index 0400b7c..7173c91 100644 (file)
--- a/index.php
+++ b/index.php
@@ -42,6 +42,7 @@
                             } else {
                                 // If not, and I am clearly not frontpage (checked above), I must be an entity landing page
                                 include __DIR__.'/sections/entity-landing.php';
+
                             }
                         }
                     }
index f5ada0e..a82de4e 100644 (file)
@@ -1,7 +1,25 @@
+<?php
+switch($GLOBALS['entity_page_slug']){
+    case "government":
+        $cat = '3';
+        break;
+    case "chamber-of-commerce":
+         $cat = '4';
+        break;
+    case "convention-visitors-bureau":
+         $cat = '5';
+        break;
+    case "edc":
+         $cat = '6';
+        break;
+    default:
+         $cat = '';
+        break;
+}?>
 
 <div id="sidebar" class="small-12 large-4 columns">
     <h1>Events</h1>
-    <?php echo do_shortcode('[glm-members-event-list template="eventsFrontPage.html" category="1"]'); ?>
+    <?php echo do_shortcode("[glm-members-event-list template='eventsFrontPage.html' category='$cat' limit=3]"); ?>
     <?php $eventsPage = get_post(674);?>
     <?php if($eventsPage):?>
         <a id="calendar-link" href="<?php echo get_page_link($eventsPage->ID);?>"><img alt="View all events" src="<?php bloginfo('template_url'); ?>/assets/view-all-events-button.png"></a>
index 305a290..04fe829 100644 (file)
@@ -60,7 +60,7 @@ default:
         </div>
     </div>
     <?php endforeach;?>
-    <?php get_template_part('parts/event-feed'); ?>
+    <?php include 'event-feed.php'; ?>
 </div>
 <!--<div class="separator"><hr></div>-->
 <?php endif;?>
index 0c62fc0..3371843 100644 (file)
@@ -13,7 +13,8 @@
                                 echo "</div>";
                             }
                             get_template_part('parts/main-content');
-                            get_template_part('parts/glm-blocks');
+//                            echo bloginfo('template_directory').'/parts/glm-blocks.php';
+                            include __DIR__.'/../parts/glm-blocks.php';
                         echo "</div>";
                     } ?>
             <?php// } ?>