Created
September 27, 2017 18:30
-
-
Save conschneider/f4ea9adc521d6caf54910728a3f26184 to your computer and use it in GitHub Desktop.
WordPress check if post has custom taxonomy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// use of function has_term( 'slug', 'taxonomy_name', $post->ID ); | |
// taxonomy_name for example: Visibility | |
// slug for example: visible | |
// $post->ID = current post | |
$terms = has_term( 'intern', 'artikel_typ', $post->ID ); | |
if($terms) | |
{ | |
//do something | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment