Support » Fixing WordPress » Two Conditional Tags

  • piginzen

    (@piginzen)


    Is it possible to use two conditions and combine in to one?

    So I dont have to do this:
    <?php if(is_home()) : ?>
    <div class=”sb_search”><h2><?php _e(‘Search’); ?></h2>
    <?php include (TEMPLATEPATH . ‘/searchform.php’); ?>
    </div>
    <?php endif; ?>
    <?php if(is_archive()) : ?>
    <div class=”sb_search”><h2><?php _e(‘Search’); ?></h2>
    <?php include (TEMPLATEPATH . ‘/searchform.php’); ?>
    </div>
    <?php endif; ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Kafkaesqui

    (@kafkaesqui)

    <?php if(is_home() || is_archive()) : ?>
    <div class="sb_search"><h2><?php _e('Search'); ?></h2>
    <?php include (TEMPLATEPATH . '/searchform.php'); ?>
    </div>
    <?php endif; ?>

    piginzen

    (@piginzen)

    bingo!

    thanks so much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Two Conditional Tags’ is closed to new replies.