WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to add an ad banner to my wordpress homepage (in the header) plus a separate ad banner for all other pages (in the header). I did get the banner up for just the homepage but I'm trying to figure the code to complete this issue.

<?php if ( is_home() ) { ?><div id="banner">my content</div><?php } ?>

How can I get another ad banner on all other pages/posts? Thanks.

share|improve this question
up vote 0 down vote accepted

What about

<?php if ( is_home() ) { ?><div id="banner">my content</div><?php } else { ?><div id="banner">not-home banner/div><?php } ?>
share|improve this answer
Perfect! Thanks so much! – eddie Jun 13 '12 at 3:51

Your Answer


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.