I have this conditional statement in my header.php file to give my categories a specific featured image
PHP Code:
<?php //check for category 5
if ( is_category'5' ) ) : ?>
<img src="wp-content/themes/GMPC/images/header_img5.png" width="<?php echo HEADER_IMAGE_WIDTH?>" height="<?php echo HEADER_IMAGE_HEIGHT?>" alt="" />
<?php //check for category 6
elseif ( is_category'6' ) ) : ?>
<img src="wp-content/themes/GMPC/images/header_img6.png" width="<?php echo HEADER_IMAGE_WIDTH?>" height="<?php echo HEADER_IMAGE_HEIGHT?>" alt="" />
<?php //check for category 7
elseif ( is_category'7' ) ) : ?>
<img src="wp-content/themes/GMPC/images/header_img7.png" width="<?php echo HEADER_IMAGE_WIDTH?>" height="<?php echo HEADER_IMAGE_HEIGHT?>" alt="" />
<?php
// Check if this is a post or page, if it has a thumbnail, and if it's a big one
elseif ( is_singular() && current_theme_supports'post-thumbnails' ) && has_post_thumbnail$post->ID ) && ( /* $src, $width, $height */ $image =  wp_get_attachment_image_srcget_post_thumbnail_id$post->ID ), 'post-thumbnail' ) ) &&
$image[1] >= HEADER_IMAGE_WIDTH ) :
// Houston, we have a new header image!
echo get_the_post_thumbnail$post->ID );
elseif ( 
get_header_image() ) : ?>
<img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH?>" height="<?php echo HEADER_IMAGE_HEIGHT?>" alt="" />
<?php endif; ?>
Myquestion is how do make te featred image show up if a single post is looked at from either (5, 6, or 7)
My guess is to add
PHP Code:
|| is_single() 
on the line where I check the category, but I dont know how to narrow the function is_single() down to a specific category