Fix single page for events
authorLaury GvR <laury@gaslightmedia.com>
Fri, 22 Jan 2016 15:32:33 +0000 (10:32 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Fri, 22 Jan 2016 15:32:33 +0000 (10:32 -0500)
functions.php
single.php

index 380f17a..89920f5 100644 (file)
@@ -142,6 +142,12 @@ function mytheme_search_loop() {
   <?php endwhile;
 }
 
+function is_post_type($type){
+    global $wp_query;
+    if($type == get_post_type($wp_query->post->ID)) return true;
+    return false;
+}
+
 add_action('thematic_searchloop', 'mytheme_search_loop');
 // End of the Contextual/Highlight Search functions
 add_image_size('glm_blocks', '570', '590', true);
index d80a7ac..532e98a 100644 (file)
@@ -9,7 +9,15 @@
 </div>
 <main class="blog-single">
     <div class="row">
+        <?php if (get_post_type( $post ) == "ai1ec_event") { ?>
+        <div id="blog-posts-over" class="ai1ec-post small-12 medium-10 medium-centered columns">
+
+        <?php
+        get_template_part('parts/bread-crumbs');
+        ?>
+        <?php } else { ?>
         <div id="blog-posts-over" class="small-12 medium-9 columns">
+        <?php } ?>
             <h1>Sault Ste Marie's Blog</h1>
             <?php if(have_posts()) : while(have_posts()): the_post();?>
             <div class="row blog-post-container">
@@ -25,7 +33,7 @@
                                     <span class="meta date">Posted on <?php the_time('F jS, Y') ?></span>
                                 </header>
 
-                                <?php if (get_post_type( $post ) != "ai1ec_event") { ?>
+                                <?php if (!is_post_type("ai1ec_event")) { ?>
                                 <div id="addthis_wrapper">
                                     <!-- AddThis Button BEGIN -->
                                     <div class="addthis_toolbox addthis_default_style ">
@@ -79,8 +87,9 @@
             </div><!-- /#post-404 -->
             <?php endif;?>
         </div>
-
-        <?php get_template_part('parts/blog-sidebar-r'); ?>
+        <?php if (!is_post_type("ai1ec_event")) { ?>
+            <?php get_template_part('parts/blog-sidebar-r'); ?>
+        <?php } ?>
 
     </div>
     <?php get_footer(); ?>