Conditional Tags

Send Snippet To: Save this snippet to Code Collector Pro -- view all ceniack's snippets
language: PHP
license: Other

Code for Snippet:

<?php  if ( is_page('First_Page') ) { ?><br>  
<img src="image.gif" /><br>  
<?php  } elseif ( is_page('Third_Page') ) { ?><br>  
<p>Here is some text?¢¬Ä¬¶.</p><br>  
<?php  } else { ?><br>  
<?php  } ?>
<?php  if(is_category(Category_Page) ) || ( is_single(Single_Page))  { ?>  
<p>Display  this text?¢¬Ä¬¶.</p>  
<?php  } else { ?>  
<?php  } ?>
//Conditional Scripts if page
<?php  if ( is_page( 'contact_us_page' ) ) {   ?>  
<link  rel='stylesheet' href='/contactusform.css' type='text/css' media='all' />  
<script  type='text/javascript' src=k'/jqueryform.js'></script>  
<script  type='text/javascript' src='/spec_forms.js'></script>  
<?php  } ?>
//Conditional Custom Post Types
<?php  if ( review_entry' == get_post_type() ) { ?> 
<div  id="reviewcontact"> 
<p>If  you're impressed by the  reviews, kindly  contact us asap. Give us a call or <a href="/contact"  title="Contact Us">CLICK HERE</a> to send us a message!</p>  
<?php  } ?>
comments powered by Disqus


Source Site:

Tags: Wordpress

Link to this snippet:

Download to Code Collector

To use the direct link to your snippet on either copy the html from the above section or drag the Download to Code Collector to where you would like to use it.

More Info:

Times Viewed: 725
Date Added: 2014-04-10 18:20:28
Last Modified: 2014-04-10 12:23:37

Web Analytics