为所有帖子设置默认图像

I am using this code to have the Featured Image set on all Pages as a banner, in the header. So all pages have different banners:

<img src="<?php $imgsrc = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID) , 'full'); echo $imgsrc[0]; ?>" class="middle" alt="banner">

I don't want to use this for Posts because I need to set different small pics there. I need a way to automatically have all Posts use a default image banner that wouldn't take the spot of the Featured Image that I need freed up. Is there a way to auto detect that it's a Post page and have that default image instead?

Tried everything I could find on search engines, but I can't figure out.

One solution (if you use the same template for posts and pages) is to use the function get_post_type() to check the post type:

if( 'post' == get_post_type() ) {
    // load image for posts
} else {
    // image for pages
}

Another solution is to use a template for posts (like single.php, or single-post.php if you have other custom post types) and one for pages (page.php), so you can use different code on different post types.