Title: Featured Images
Last modified: August 21, 2016

---

# Featured Images

 *  [wdejesus](https://wordpress.org/support/users/wdejesus/)
 * (@wdejesus)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/featured-images-30/)
 * Hello everyone,
 * I am finishing up our site and have ran into a snag. I have a featured image 
   script for pages and so on. I have the blog page connected, but when I create
   a new post, the featured image on that post goes into my featured image header
   which I don’t want it to do. So basically I want to have a featured image header
   for my pages which works, but also for my blog page without the featured image
   for the post showing up. Below you will find the URL of the page and also my 
   code.
 * [http://gracechurch.wsoa.biz/](http://gracechurch.wsoa.biz/)
    [http://gracechurch.wsoa.biz/blog/](http://gracechurch.wsoa.biz/blog/)
 *     ```
       <?php
   
       		if(has_post_thumbnail() && !is_single()) {
   
       			(int) $thumb_id = get_post_thumbnail_id();
   
       			$thumb_details = wp_get_attachment_image_src( $thumb_id, 'full' );
   
       		} elseif(is_home() || is_single()) {
   
       			$page_for_posts = get_option('page_for_posts');
   
       			global $wp_query;
   
       			if ($wp_query->is_posts_page && has_post_thumbnail( $page_for_posts )) {			
   
       				$thumb_details = wp_get_attachment_image_src( $page_for_posts, 'full' );
   
       			} else {
   
       				$thumb_details = NULL;
   
       			}
   
       		} else {
   
       			if(!empty($post->ancestors)) {
   
       				(int) $ancestor_id = end($post->ancestors);
   
       				$thumb_id = get_post_thumbnail_id($ancestor_id);
   
       				if(empty($thumb_id)) {
   
       					$thumb_details = NULL;
   
       				} else {				
   
       					$thumb_details = wp_get_attachment_image_src( $thumb_id, 'full' );	
   
       				}
   
       			} else {                                                     
   
       				$thumb_details = NULL;				
   
       			}                                      
   
       		}
   
       		$thumb_path = (!empty($thumb_details) ? $thumb_details[0]: '/wp-content/themes/grace-church-2013/images/inside-banner.png');
   
       		$splashInterior = "width: 1600px; height: 337px; background: url(" .$thumb_path . ") no-repeat;";
   
       	?><!-- end of Jessica's script -->
   
         		<div id="inside-banner" style="<?php echo $splashInterior; ?>"></div>
   
         		<?php  }?>
   
       		</div>
       ```
   

The topic ‘Featured Images’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [wdejesus](https://wordpress.org/support/users/wdejesus/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/featured-images-30/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
