Removed old featured function grabbing on all pages.
authorLaury GvR <laury@gaslightmedia.com>
Tue, 9 Feb 2016 20:38:28 +0000 (15:38 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 9 Feb 2016 20:38:28 +0000 (15:38 -0500)
functions.php
home.php
index.php
search.php
single.php

index acea239..092d849 100644 (file)
@@ -79,26 +79,26 @@ function glm_site_scripts()
 
 
 /* Header for posts*/
-function glm_get_header() {
-    global $post;
-    $post_id = $post->ID;
-    echo '<div class="featured-container"><div';
-    // inherit featured image from parent pages
-    if ( $post->post_parent && !has_post_thumbnail($post->ID)){
-        $post_id = $post->post_parent;
-    }
-
-    if (has_post_thumbnail($post_id) && (!(is_home()) ) && (!(is_single())) && (!(is_archive())) && (!(is_search()))) {
-            $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), "full");
-            echo ' style="background-image: url('.$image_data[0].');height:0;padding:0;padding-bottom:30%;background-position:center center;background-size: cover;background-repeat:no-repeat;max-height: 420px;min-height: 150px; "';
-    } else {
-            echo ' style="background-image: url('.get_template_directory_uri().'/assets/things-to-do.jpg);height:0;padding:0;padding-bottom:30%;background-position:center center;background-size: cover;background-repeat:no-repeat;max-height: 420px; min-height: 150px;"';
-            echo ' class="no-featured"';
-    }
-    echo '>';
-    echo '</div>';
-    echo '</div>';
-}
+//function glm_get_header() {
+//    global $post;
+//    $post_id = $post->ID;
+//    echo '<div class="featured-container"><div';
+//    // inherit featured image from parent pages
+//    if ( $post->post_parent && !has_post_thumbnail($post->ID)){
+//        $post_id = $post->post_parent;
+//    }
+//
+//    if (has_post_thumbnail($post_id) && (!(is_home()) ) && (!(is_single())) && (!(is_archive())) && (!(is_search()))) {
+//            $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), "full");
+//            echo ' style="background-image: url('.$image_data[0].');height:0;padding:0;padding-bottom:30%;background-position:center center;background-size: cover;background-repeat:no-repeat;max-height: 420px;min-height: 150px; "';
+//    } else {
+//            echo ' style="background-image: url('.get_template_directory_uri().'/assets/things-to-do.jpg);height:0;padding:0;padding-bottom:30%;background-position:center center;background-size: cover;background-repeat:no-repeat;max-height: 420px; min-height: 150px;"';
+//            echo ' class="no-featured"';
+//    }
+//    echo '>';
+//    echo '</div>';
+//    echo '</div>';
+//}
 function glm_get_featured() {
     if (has_post_thumbnail()) {
         $image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full");
@@ -108,17 +108,6 @@ function glm_get_featured() {
     }
     return $imageUrl; 
 }
-// // The code below is useful when you want the image to resize to
-//    if (has_post_thumbnail()) {
-//            $image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full");
-//            echo '<img src="'.$image_data[0].'" style="no-repeat;max-height:400px;">';
-//    } else {
-//            echo '<img src="'.get_template_directory_uri().'/assets/default-header.gif" style="max-height:400px;">';
-//    }
-//    echo '<div class="row">';
-//    echo '<div class="small-12 columns">';
-//    echo '</div>';
-//    echo '</div>';
 
 add_action('wp_enqueue_scripts', 'glm_site_scripts');
 
index 973b7a0..c7cde60 100644 (file)
--- a/home.php
+++ b/home.php
@@ -1,5 +1,7 @@
 <?php get_header(); ?>
-<?php glm_get_header(); ?>
+<div class="featured-container">
+    <?php echo glm_get_featured(); ?>
+</div>
 <div id="crumb-line">
     <div class="row">
         <?php
index b1813ca..f1368b2 100644 (file)
--- a/index.php
+++ b/index.php
@@ -5,7 +5,6 @@
             get_template_part('parts/glm-kitchen-sink');
         } else { ?>
         <div id="content-wrapper">
-            <?php // glm_get_header();?>
             <div class="featured-container">
                 <?php echo glm_get_featured(); ?>
             </div>
index f0f4d20..6c69d82 100644 (file)
@@ -1,5 +1,7 @@
 <?php get_header(); ?>
-<?php GLM_get_header(); ?>
+<div class="featured-container">
+    <?php echo glm_get_featured(); ?>
+</div>
 <main class="search-results">
     <div class="row">
         <?php if (get_search_query() == "") { ?>
index 67e37d8..17e2231 100644 (file)
@@ -1,5 +1,7 @@
 <?php get_header(); ?>
-<?php glm_get_header(); ?>
+<div class="featured-container">
+    <?php echo glm_get_featured(); ?>
+</div>
 <?php if (!is_post_type("ai1ec_event")) { ?>
 <div id="crumb-line">
     <div class="row">