endif;
/* 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_featured() {
global $post;
$post_id = $post->ID;
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");
$imageUrl = '<div class="featured-container"><div class="featured-image" style="background: url(\''.$image_data[0].'\') no-repeat scroll 0px 0px / cover;;"></div></div>';
- } elseif(is_single() && is_post_type('ai1ec_event')){
+ } elseif(is_single() && is_post_type('ai1ec_event')) {
$image_data = wp_get_attachment_image_src(get_post_thumbnail_id(123), "full");
$imageUrl = '<div class="featured-container"><div class="featured-image" style="background: url(\''.$image_data[0].'\') no-repeat scroll 0px 0px / cover;;"></div></div>';
- } elseif(is_post_type('post')) {
- $imageUrl = '<div class="featured-container"><div class="featured-image" style="background: url(\''.get_template_directory_uri().'/assets/Downtown.jpg\') no-repeat scroll 0px 0px / cover;;"></div></div>';
- }
- else {
+ } else {
$imageUrl = '<div class="featured-container"><div class="featured-image" style="background: url(\''.get_template_directory_uri().'/assets/summer-header.png\') no-repeat scroll 0px 0px / cover;;"></div></div>';
}
return $imageUrl;