Conditional Tags

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

Code for Snippet:

                
//is_page
<?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  } ?>
//is_category
<?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>  
</div>  
<?php  } ?>
 
 
comments powered by Disqus

Info

Source Site:

http://www.codecollector.net/view/codecollector://5E010932-ADE2-45C5-8F1B-8B71AA0076D1-29951-0000B63C6E2254BE

Tags: Wordpress

Link to this snippet:


Download to Code Collector

To use the direct link to your snippet on CodeCollector.net 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: 740
Date Added: 2014-04-16 21:32:10
Last Modified: 2014-04-17 12:33:24

Web Analytics