Posts tagged: categories
The Difference Between Taxonomies, Categories, and Tags (Oh My!)
A common question for new WordPress users is, “what’s the difference between categories and tags?” Like everyone knows what a “category” is, but the idea of “tags” can seem very similar. And then you throw in related WordPress concepts like “taxonomy”, and things can get confusing very quickly. But no worries, it’s really not that complicated. Let’s break it down..
How to Check if Post has Taxonomy Term
Something I did not know about when working with Custom Post Types and Custom Taxonomies. Normally when checking if a regular WP Post belongs to a specific category, we can use the WordPress function in_category(). But that does not work with Custom Post Types. To check if a CPT belongs to a specific term in a Custom Taxonomy, use has_term() instead.
Include the Category ID via post_class
The default output for WordPress’
post_class template tag includes class names for just about every type of page view imaginable: