Trying to switch header image if on home page

Posted by novicePrgrmr on Stack Overflow See other posts from Stack Overflow or by novicePrgrmr
Published on 2012-09-23T15:34:37Z Indexed on 2012/09/23 15:37 UTC
Read the original article Hit count: 211

Filed under:
|
|

New to PHP, and wondering what is wrong with this code because its definitely not switching the header img.

This is what is used to be:

<a href="http://www.finegra.in"><img id="logo" alt="fine grain Logo"    src="http://www.finegra.in/wp-content/uploads/2012/04/fineGRAINlogoGOOD-WEB.png">

This is what I changed it to:

<?php if (is_home()) { ?> <a href="http://www.finegra.in"><img id="logo" alt="fine grain Logo"  src="http://www.finegra.in/wp-content/uploads/2012/09/finegrain-logo-sept.png">
</a> 
<?php }
else { ?>
<a href="http://www.finegra.in"><img id="logo" alt="fine grain Logo"    src="http://www.finegra.in/wp-content/uploads/2012/04/fineGRAINlogoGOOD-WEB.png">
</a>
<?php } ?>

© Stack Overflow or respective owner

Related posts about php

Related posts about html