Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Im trying to make my home page have one type of header which is different from every other page. I have made a page the front page in the settings called home and in header.php i have changed the code to this:

<?php if(is_home()) {?>
        <hgroup>
            <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php echo "Hello World" ?>"/></a></h1>
        </hgroup>
    <?php } else {?>
        <hgroup>
            <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php bloginfo('template_url'); ?>/images/Cranbri-web-solutions.png"/></a></h1>
        </hgroup>
    <?php } ?>

Can anyone see whats wrong? because for some reason the header inst changing??

Thanks

share|improve this question
    
use is_front_page() instead, or target the actual page id and use is_page($x) where $x is the id of the page in question –  GhostToast Dec 23 '13 at 19:04

1 Answer 1

up vote 0 down vote accepted

Since you have a static page as the front page, use is_front_page() instead of is_home() in the condition.

share|improve this answer
    
Perfect thankyou! Been a while since i have used wordpress! –  Tom Burman Dec 23 '13 at 18:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.