<?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.
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”>
<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” 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 with is still in development.
Thanks
Thanks
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;
}
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.
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
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?
is_home() or is_front_page() should always work on your home page.