/* Header for posts*/
function glm_get_header() {
+ global $post;
+
echo '<div';
+ // inherit featured image from parent pages
+ if ( $post->post_parent ){
+ $post_id = $post->post_parent;
+ }
+ else
+ $post_id = $post->ID;
- if (has_post_thumbnail()) {
- $image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full");
+ if (has_post_thumbnail($post_id)) {
+ $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: 100%;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: 100%;background-repeat:no-repeat;max-height: 420px; min-height: 150px;"';
add_action('thematic_searchloop', 'mytheme_search_loop');
// End of the Contextual/Highlight Search functions
//add_image_size('glm_blocks', '570', '280', true);
+
+
?>