0

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

1
  • 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
0

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

1
  • Perfect thankyou! Been a while since i have used wordpress!
    – Tom Burman
    Dec 23 '13 at 18:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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