ryanemitchell
9/15/2017 - 2:50 PM

[if is or is not page] #wordpress #php

[if is or is not page] #wordpress #php

<?php
if (is_page('12')) {
    // below content only show when page id is 12
    echo 'This is page id 12';

} elseif ( is_page( '14' ))  {  
// if page id is 14 then it will show below line only
echo 'Email me for to discuss your project';

}

// if page id is not 12 & 14 then below line will be print
else { 
  echo 'Get Your Water Bore Quote Here!';
  } 


?>
	<?php if( ! is_page( array( 'thank-you-coupons', 'student-work' ) ) ) {

		echo ('bacon');

		/* ... */ } ?>
		
		
		<?php
		if(is_page('home')) { 
    // do something
  } else if (is_page('bacon')) {
    // do something
  } else { 
    // do something else
}

?>