From: Anthony Talarico Date: Tue, 16 May 2017 16:44:59 +0000 (-0400) Subject: adding new default image for pages X-Git-Tag: v1.0.0^2~3 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=75da88544092bca76f4608fdcb4e01f8a50379ca;p=WP-Themes%2Fgreatlakescfa.git adding new default image for pages added a conditional to the functions file to set a new default page image if there is no featured image set in post type pages --- diff --git a/assets/Center-skinny-1.jpg b/assets/Center-skinny-1.jpg new file mode 100644 index 0000000..d874288 Binary files /dev/null and b/assets/Center-skinny-1.jpg differ diff --git a/functions.php b/functions.php index b4ae400..6cf6cc7 100644 --- a/functions.php +++ b/functions.php @@ -83,10 +83,13 @@ function glm_get_header() { if (has_post_thumbnail() && is_post_type('page')) { $image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full"); echo ' style="background-image: url('.$image_data[0].');height:0;padding:0;padding-bottom:20%;background-position:top center;background-size: 100%;background-repeat:no-repeat;max-height: 300px;overflow-y: hidden; "'; - } else { + } else if(is_post_type('post') ){ echo ' style="background-image: url('.get_template_directory_uri().'/assets/News-header.png);height:0;padding:0;padding-bottom:20%;background-position:top center;background-size: 100%;background-repeat:no-repeat;max-height: 300px;overflow-y: hidden;"'; echo ' class="no-featured"'; - } + } else if(!has_post_thumbnail() && is_post_type('page')){ + echo ' style="background-image: url('.get_template_directory_uri().'/assets/Center-skinny-1.jpg);height:0;padding:0;padding-bottom:20%;background-position:top center;background-size: 100%;background-repeat:no-repeat;max-height: 300px;overflow-y: hidden;"'; + echo ' class="no-featured"'; + } echo '>'; echo ''; echo '
';