batfan
5/6/2014 - 11:40 PM

WP Page Specific Statements

WP Page Specific Statements

<?php
// Single page
  if ( is_page('contact') ) {
      // echo nothing on the contact page
      echo '';

  } else {
      // get the search form on all other pages
      get_search_form();

  }
?>

<?php
// Multi-page
  if ( is_page(array('contact', 'about')) ) {
      // echo nothing on the contact and about pages
      echo '';

  } else {
      // get the search form on all other pages
      get_search_form();

  }
?>

<?php
// Multi-page, NOT these pages
  if ( !is_page(array('contact', 'about')) ) {
      // echo nothing if we're not on the contact and about pages
      echo '';

  } else {
      // get the search form on all other pages
      get_search_form();

  }
?>