Posted By

hstothard on 02/08/10


Tagged

wordpress


Versions (?)

Wordpress - If is string


 / Published in: PHP
 

  1. <?php $category = get_the_category();?>
  2.  
  3. <?php if($category[0]->cat_name == 'Title1'): ?>
  4. <h2>Title 1</h2>
  5. <?php else : ?>
  6. <h2>Title 2</h2>
  7. <?php endif ?>

Report this snippet  

You need to login to post a comment.