Header changes with conditionals
-
Hey,
Searched fairly thoroughly to find someone who had the same problem but couldn’t. I’m using wordpress with comic press.
fist off, here is the link to the site ( https://www.patgrantart.com )
What I want to do is configure the blog so that a large banner comes up on the home page sitting perfectly on top of a nice rack of animated buttons that I built. I have that set up nicely right now
Banner is here.
The thing is I don’t need the banner on every page. I only want it on the home page because my site visitors don’t need to see it more than once. I have made an alternative image to replace the banner which sits nicely on the top of my button rack which I will hopefully have in place of the banner on every other page.
The alternative banner image is here
So. I’ve been trying to write some conditional tags into the header sheet but every time I do I break the code.
here’s what I tried
<?php if (is_home()) { echo "<img src="https://www.patgrantart.com/wp-content/themes/comicpress/banner.jpg">"; } else { echo "<img src="https://www.patgrantart.com/wp-content/themes/comicpress/banner.jpg">"; } ?>
i dropped this in right after the opening of the ‘header’ div.
I also tried replacing the echo “<img src?” thing with ‘bannerimg=’
that didn’t work either.
anyway. any input would be appreciated.
Regards, Pat
- The topic ‘Header changes with conditionals’ is closed to new replies.