Skip to content

Instantly share code, notes, and snippets.

@barbwiredmedia
Created May 6, 2014 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barbwiredmedia/31778ef9562b37202908 to your computer and use it in GitHub Desktop.
Save barbwiredmedia/31778ef9562b37202908 to your computer and use it in GitHub Desktop.
Wordpress has term, categories, taxomomy. Can be used in the loop or wp_query where your_taxonomy_name = the custom taxonomy name and a_term_name is a created term
<?php if (has_term('a_term_name', 'your_taxonomy_name')): ?>
//stuff here
<?php elseif (has_term('another_term_name', 'your_taxonomy_name')): ?>
//stuff
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment