Last active
July 5, 2017 21:20
-
-
Save marcosnakamine/6139d7ab8f4a4cf96b915528bc61d36c to your computer and use it in GitHub Desktop.
WordPress - Get current taxonomy
This file contains hidden or 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
<? | |
var_dump( get_queried_object() ); | |
/*OR*/ | |
$terms = get_the_terms( get_the_ID(), 'taxonomy'); | |
/* | |
object(WP_Term)#9039 (11) { | |
["term_id"]=> | |
int(80) | |
["name"]=> | |
string(2) "NAME" | |
["slug"]=> | |
string(2) "name" | |
["term_group"]=> | |
int(0) | |
["term_taxonomy_id"]=> | |
int(80) | |
["taxonomy"]=> | |
string(22) "taxonomy_name" | |
["description"]=> | |
string(0) "" | |
["parent"]=> | |
int(0) | |
["count"]=> | |
int(1) | |
["filter"]=> | |
string(3) "raw" | |
["term_order"]=> | |
string(1) "0" | |
} | |
*/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment