Title: Help with header images&#8230;Please
Last modified: August 19, 2016

---

# Help with header images…Please

 *  [hlbuckner2](https://wordpress.org/support/users/hlbuckner2/)
 * (@hlbuckner2)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/help-with-header-imagesplease/)
 * I would like the header image displayed on the home page with one image and all
   the other subpages with a different header image (smaller).
 * I was wonder if there is a way to test if you are on the “home Page” and if so…
   use this image…if not, use this one.
 * I don’t know php script but if some one can provide it for me to add to the header,
   I would appriciate it.
 * Thanks

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/help-with-header-imagesplease/#post-1148513)
 *     ```
       <?php if(is_home()) :?>
       [ do stuff ]
       <?php endif;?>
       ```
   
 * Is the best I can offer since I have no idea what your site looks like or uses
   to display the header image.
 *  Thread Starter [hlbuckner2](https://wordpress.org/support/users/hlbuckner2/)
 * (@hlbuckner2)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/help-with-header-imagesplease/#post-1148518)
 * Thanks esmi.
 * I was sitting the background here in css
 * #welcomeheading {
    text-align: center; background: url(img/BucknerCoatofArmsHeader_edited-
   1.jpg) top left no-repeat; background-repeat: no-repeat; height: 250px; width:
   940px; text-align: center position: relative; }
 * but I think I could use your code in the header
 * <div id=”welcomeheading”>
    [](https://wordpress.org/?output_format=md) <h1>/”
   >
 * <!– comment out and added image to css style sheet.
 * <img src=”[http://www.mistyriverphoto.com/wp-content/themes/sliding-door/img/BucknerCoatofArmsHeader_edited-1.jpg&#8221](http://www.mistyriverphoto.com/wp-content/themes/sliding-door/img/BucknerCoatofArmsHeader_edited-1.jpg&#8221);
   BORDER=0 > –>
 * <?php $replacethese = array(‘[‘,’]’);
    $replacewith = array(‘<span id=”middleword”
   >’,'</span>’); echo str_replace($replacethese, $replacewith, get_bloginfo(‘title’));?
   > </h1> </div>
 * Can this code be added to the css style sheet or does it hae to be in the header?
 * My site is [http://www.haroldbucknerphotography.com](http://www.haroldbucknerphotography.com)
   with is still in development.
 * Thanks
 * Thanks
 *  Thread Starter [hlbuckner2](https://wordpress.org/support/users/hlbuckner2/)
 * (@hlbuckner2)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/help-with-header-imagesplease/#post-1148530)
 * I tried this but I get no image on any page
 * #welcomeheading {
    text-align: center; <?php if(is_home()) :?> background: url(
   img/BucknerCoatofArmsHeader_edited-1.jpg) top left no-repeat; background-repeat:
   no-repeat; <?php endif;?> height: 250px; width: 940px; text-align: center position:
   relative; }
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/help-with-header-imagesplease/#post-1148549)
 * In header.php, try changing:
 *     ```
       <div id="wrapper">
       <div id="welcomeheading">
       ```
   
 * to
 *     ```
       <div id="wrapper">
       <?php if(is_home()) $hstyle='welcomeheading';
       else $hstyle='welcomeheading2';?>
       <div id="<?php echo $hstyle;?>">
       ```
   
 * The add the following to style.css:
 *     ```
       #welcomeheading2 {
       text-align: center;
       background: url(img/new_header_image.jpg) top left no-repeat;
       background-repeat: no-repeat;
       height: 150px;
       width: 940px;
       text-align: center
       position: relative;
       }
       ```
   
 * Adjust the height to suit your new header image accordingly.
 *  Thread Starter [hlbuckner2](https://wordpress.org/support/users/hlbuckner2/)
 * (@hlbuckner2)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/help-with-header-imagesplease/#post-1148598)
 * I tried doing your code but the <?php if(is_home()) $hstyle=’welcomeheading’;
   
   is testing as false and the home page is picking up the #welcomeheading2 style.
 * Any ideas why is_home() = false
 * Thanks
 *  Thread Starter [hlbuckner2](https://wordpress.org/support/users/hlbuckner2/)
 * (@hlbuckner2)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/help-with-header-imagesplease/#post-1148610)
 * Hey esmi,
 * I changed your code to use the is_front_page() function and it works. Any issues
   with that in the future or should is_home() work on my home page?
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/help-with-header-imagesplease/#post-1148632)
 * is_home() or is_front_page() should always work on your home page.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Help with header images…Please’ is closed to new replies.

 * 7 replies
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [16 years, 10 months ago](https://wordpress.org/support/topic/help-with-header-imagesplease/#post-1148632)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
