// echo '</div>';
//}
function glm_get_featured() {
- if (has_post_thumbnail()) {
+ global $post;
+ $post_id = $post->ID;
+ // 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(), "full");
$imageUrl = '<div class="featured-image" style="background: url(\''.$image_data[0].'\') no-repeat scroll 0px 0px / cover;;"></div>';
} else {