Title: Boolean taxonomy
Last modified: August 19, 2016

---

# Boolean taxonomy

 *  [lerizzle](https://wordpress.org/support/users/lerizzle/)
 * (@lerizzle)
 * [15 years ago](https://wordpress.org/support/topic/boolean-taxonomy/)
 * How would one register a Boolean taxonomy? For instance it’s either ‘in stock’
   or ‘sold out’. I want to explicitly say so I can display post based on it. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years ago](https://wordpress.org/support/topic/boolean-taxonomy/#post-2044257)
 * And where are the variables “stock” and “sold out” stored?
 *  Thread Starter [lerizzle](https://wordpress.org/support/users/lerizzle/)
 * (@lerizzle)
 * [15 years ago](https://wordpress.org/support/topic/boolean-taxonomy/#post-2044320)
 * It’s not a variable. I would like it as a taxonomy in my custom post type plugin
   so I can take advantage of all the beauty taxonomies have to offer. But with 
   hierarchal they can select both and flat all I get is a text field. What I would
   like is either radio buttons or a drop down.
 * Worst case I can use post meta but then I lose the advantages of a taxonomy. 
   But is that my only option?
 *  [Bob33](https://wordpress.org/support/users/bob33/)
 * (@bob33)
 * [15 years ago](https://wordpress.org/support/topic/boolean-taxonomy/#post-2044465)
 * I’m looking for similar information in order to filter a function (using if, 
   elseif etc) based on the post having a particular custom taxonomy value.
 * Say for instance I wanted to change the postfooter based on the custom taxonomy‘
   location’ having a particular value eg London.
 * If it was a tag I could use ‘has_tag()’. If it was a category I could use ‘in_category()’.
 * But how do I achieve a Boolean operation with taxonomies? I know about ‘taxonomy_exists()’,
   but haven’t managed to track down a way to make it work in that way.
 * Any takers? 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Boolean taxonomy’ is closed to new replies.

## Tags

 * [register_taxonomy](https://wordpress.org/support/topic-tag/register_taxonomy/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [Bob33](https://wordpress.org/support/users/bob33/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/boolean-taxonomy/#post-2044465)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
