Featured image not for event page
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 28 Sep 2015 14:03:19 +0000 (10:03 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 28 Sep 2015 14:03:19 +0000 (10:03 -0400)
if it is single post page and an event then use default header

functions.php

index 52be669..c9d1a56 100644 (file)
@@ -202,14 +202,15 @@ function glm_site_scripts()
 
 
 /* Header for posts*/
-function glm_get_background() {    
-    if (has_post_thumbnail()) {
+function glm_get_background() {
+    $eventPage = (is_single() && is_post_type('ai1ec_event'));
+    if (has_post_thumbnail() && !$eventPage) {
         $image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full");
         $imageUrl = '<div class="featured-image" style="background: url(\''.$image_data[0].'\') no-repeat scroll 0px 0px / cover;;"></div>';
     } else {
         $imageUrl = '<div class="featured-image" style="background: url(\''.get_template_directory_uri().'/assets/example-interior-pg-haeder-image.jpg\') no-repeat scroll 0px 0px / cover;;"></div>';
     }
-    return $imageUrl; 
+    return $imageUrl;
 }