I cannot find the error in this if-else statement
-
would someone please give me a hand with this code? If conditions are met, I want a different image. Seems simple! But I’m getting a t-string error. It doesn’t like the very first string.
<?php if (is_front_page()) {echo '<img class="lower" src="<?php bloginfo('template_directory');?>/images/splash.jpg" usemap="#bg" style="border:none;" alt="background"/>'; } elseif (is_page('Portfolio')) /*use portfolio image*/{ echo '<img class="lower" src="<?php bloginfo('template_directory');?>/images/portfolio.jpg" usemap="#bg" style="border:none;" alt="background"/>'; } elseif (is_page('Ordering')) { /*use ordering image*/ echo '<img class="lower" src="<?php bloginfo('template_directory');?>/images/ordering.jpg" usemap="#bg" style="border:none;" alt="background"/>'; } else { /*for everything else use "blog" image*/ echo '<img class="lower" src="<?php bloginfo('template_directory');?>/images/blog.jpg" usemap="#bg" style="border:none;" alt="background"/>'; } ?>
Thanks!
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘I cannot find the error in this if-else statement’ is closed to new replies.