WordPress.org

Ready to get started?Download WordPress

Forums

Two Conditional Tags (3 posts)

  1. piginzen
    Member
    Posted 8 years ago #

    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; ?>

  2. Kafkaesqui

    Posted 8 years ago #

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

  3. piginzen
    Member
    Posted 8 years ago #

    bingo!

    thanks so much.

Topic Closed

This topic has been closed to new replies.

About this Topic